﻿@using BonjourQuotation.UI.Models.PartialModel
@using MvcCheckBoxList
@model OperationBusGridViewModel
@{
    Layout = null;
}
<script type="text/javascript">
    var BusModel;
    var SelectedBusGridData = [];
    var BusOldDate = [];
    debugger;
    LoadBusGrid(false);
    function LoadBusGrid(IsBusClientLoad) {
        if (!IsBusClientLoad)
            BusModel = $(@Html.Raw(Json.Encode(Model))).JSModel();
        var Buscolumns = [];
        var BuscolWidth = [];
        var BuscolumnHeaders = [];
        var BuscolOrder = [];
        var BusStatusDrop = [];
        var BusEmpdrop = [];
        var BusVnStatusDrop = [];
        var BusCurrencydrop = ["USD", "CAD"];
        var BusVendorNamedrop = [];
        var BusServicedrop = [];
        var BusGuideNamedrop = [];
        var BusPaymentMethoddrop = [];
        // BusDateOldDate
        $(BusModel[0].Rows).each(function (index, elem) {
            BusOldDate.push(elem.BusStart);
        });
        $(BusModel[0].Employee).each(function (index, elem) {
            BusEmpdrop.push(elem.Text);
        });

        $(BusModel[0].Services).each(function (index, elem) {
            BusServicedrop.push(elem.ServiceCode);
        });

        $(BusModel[0].PaymentMethod).each(function (index, elem) {
            BusPaymentMethoddrop.push(elem.Text);
        });
        $(BusModel[0].VendorInfo).each(function (index, elem) {
            BusVendorNamedrop.push(elem.VendorName);
        });
        $(BusModel[0].GuideInfo).each(function (index, elem) {
            BusGuideNamedrop.push(elem.GuideName);
        });
        $(BusModel[0].VendorStatus).each(function (index, elem) {
            BusVnStatusDrop.push(elem.Text);
        });
        if (BusModel[0].OperationBusIsInvoiceView) {
            if (BusModel[0].ViewBusIsInvoice == true) {
                BuscolumnHeaders.push($("#BusIsInvoiceDiv").html());
                BusModel[0].OperationBusIsInvoiceEdit ? Buscolumns.push({ data: "BusIsInvoice", type: "checkbox" }) : Buscolumns.push({ data: "BusIsInvoice", type: "checkbox", readOnly: true });
                BuscolWidth.push(50);
                BuscolOrder.push(BusModel[0].OperationBusIsInvoiceLineNo);
                $("#BusGridBusIsInvoiceDiv").hide();
            }
            else
                $("#BusGridBusIsInvoiceDiv").show();
        }
        if (BusModel[0].OperationBusInvoicePriceView) {
            if (BusModel[0].ViewBusInvoicePrice == true) {
                BuscolumnHeaders.push($("#BusInvoicePriceDiv").html());
                BusModel[0].OperationBusInvoicePriceEdit ? Buscolumns.push({ data: "BusInvoicePrice", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusInvoicePrice", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(90);
                BuscolOrder.push(BusModel[0].OperationBusInvoicePriceLineNo);
                $("#BusGridBusInvoicePriceDiv").hide();
            }
            else
                $("#BusGridBusInvoicePriceDiv").show();
        }
        if (BusModel[0].OperationBusGroupCodeView) {
            if (BusModel[0].ViewBusGroupCode == true) {
                BuscolumnHeaders.push($("#BusGroupCodeDiv").html());
                BusModel[0].OperationBusGroupCodeEdit ? Buscolumns.push({ data: "BusGroupCode", type: "text" }) : Buscolumns.push({ data: "BusGroupCode", type: "text", readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusGroupCodeLineNo);
                $("#BusGridBusGroupCodeDiv").hide();
            }
            else
                $("#BusGridBusGroupCodeDiv").show();
        }
        //
        if (BusModel[0].OperationBusDetailsView) {
            if (BusModel[0].ViewBusConfHtml == true) {
                BuscolumnHeaders.push($("#BusConfHtmlDiv").html());
                Buscolumns.push({ data: "BusConfHtml", renderer: "html" });
                BuscolWidth.push(80);
                BuscolOrder.push(BusModel[0].OperationBusDetailsLineNo);
                $("#BusGridBusConfHtmlDiv").hide();
            }
            else
                $("#BusGridBusConfHtmlDiv").show();
        }
        if (BusModel[0].OperationBusGroupNameView) {
            if (BusModel[0].ViewBusGroupName == true) {
                BuscolumnHeaders.push($("#BusGroupNameDiv").html());
                BusModel[0].OperationBusGroupNameEdit ? Buscolumns.push({ data: "BusGroupName", type: "text" }) : Buscolumns.push({ data: "BusGroupName", type: "text", readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusGroupNameLineNo);
                $("#BusGridBusGroupNameDiv").hide();
            }
            else
                $("#BusGridBusGroupNameDiv").show();
        }

        if (BusModel[0].OperationBusCustomerView) {
            if (BusModel[0].ViewBusCustomer == true) {
                BuscolumnHeaders.push($("#BusCustomerDiv").html());
                BusModel[0].OperationBusCustomerEdit ? Buscolumns.push({ data: "BusCustomer", type: "text" }) : Buscolumns.push({ data: "BusCustomer", type: "text", readOnly: true });
                BuscolWidth.push(200);
                BuscolOrder.push(BusModel[0].OperationBusCustomerLineNo);
                $("#BusGridBusCustomerDiv").hide();
            }
            else
                $("#BusGridBusCustomerDiv").show();
        }

        if (BusModel[0].OperationBusPaxView) {
            if (BusModel[0].ViewBusPax == true) {
                BuscolumnHeaders.push($("#BusPaxDiv").html());
                BusModel[0].OperationBusPaxEdit ? Buscolumns.push({ data: "BusPax", type: "numeric" }) : Buscolumns.push({ data: "BusPax", type: "numeric", readOnly: true });
                BuscolWidth.push(90);
                BuscolOrder.push(BusModel[0].OperationBusPaxLineNo);
                $("#BusGridBusPaxDiv").hide();
            }
            else
                $("#BusGridBusPaxDiv").show();
        }
        if (BusModel[0].OperationBusEstPaxView) {
            if (BusModel[0].ViewBusEstNumberofPerson == true) {
                BuscolumnHeaders.push($("#BusEstNumberofPersonDiv").html());
                BusModel[0].OperationAttractionEstPaxEdit ? Buscolumns.push({ data: "BusEstNoOfPerson", type: "numeric" }) : Buscolumns.push({ data: "BusEstNoOfPerson", type: "numeric", readOnly: true });
                BuscolWidth.push(90);
                BuscolOrder.push(BusModel[0].OperationBusEstPaxLineNo);
                $("#BusGridBusEstNumberofPersonDiv").hide();
            }
            else
                $("#BusGridBusEstNumberofPersonDiv").show();
        }
        ////
        //if (BusModel[0].OperationBusCostView) {
        //    if (BusModel[0].ViewBusCost == true) {
        //        BuscolumnHeaders.push($("#BusCostDiv").html());
        //        BusModel[0].OperationBusCostEdit ? Buscolumns.push({ data: "BusCost", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusCost", type: "numeric", format: '$0,0.00', readOnly: true });
        //        BuscolWidth.push(90);
        //        BuscolOrder.push(BusModel[0].OperationBusCostLineNo);
        //        $("#BusGridBusCostDiv").hide();
        //    }
        //    else
        //        $("#BusGridBusCostDiv").show();
        //}
        //
        if (BusModel[0].OperationBusGuideTotalPaidView) {
            if (BusModel[0].ViewBusGuideTotalPaid == true) {
                BuscolumnHeaders.push($("#BusGuideTotalPaidDiv").html());
                BusModel[0].OperationBusGuideTotalPaidEdit ? Buscolumns.push({ data: "BusGuideTotalPaid", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideTotalPaid", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusGuideTotalPaidLineNo);
                $("#BusGridBusGuideTotalPaidDiv").hide();
            }
            else
                $("#BusGridBusGuideTotalPaidDiv").show();
        }
        if (BusModel[0].OperationBusBusTotalPaidView) {
            if (BusModel[0].ViewBusBusTotalPaid == true) {
                BuscolumnHeaders.push($("#BusBusTotalPaidDiv").html());
                BusModel[0].OperationBusBusTotalPaidEdit ? Buscolumns.push({ data: "BusBusTotalPaid", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusBusTotalPaid", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusBusTotalPaidLineNo);
                $("#BusGridBusBusTotalPaidDiv").hide();
            }
            else
                $("#BusGridBusBusTotalPaidDiv").show();
        }
        if (BusModel[0].OperationBusGuideDifferenceView) {
            if (BusModel[0].ViewBusGuideDifference == true) {
                BuscolumnHeaders.push($("#BusGuideDifferenceDiv").html());
                BusModel[0].OperationBusGuideDifferenceEdit ? Buscolumns.push({ data: "BusGuideDifference", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideDifference", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusGuideDifferenceLineNo);
                $("#BusGridBusGuideDifferenceDiv").hide();
            }
            else
                $("#BusGridBusGuideDifferenceDiv").show();
        }
        if (BusModel[0].OperationBusGuideMiscDifferenceView) {
            if (BusModel[0].ViewBusGuideMiscDifference == true) {
                BuscolumnHeaders.push($("#BusGuideMiscDifferenceDiv").html());
                BusModel[0].OperationBusGuideMiscDifferenceEdit ? Buscolumns.push({ data: "BusGuideMiscDifference", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideMiscDifference", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusGuideMiscDifferenceLineNo);
                $("#BusGridBusGuideMiscDifferenceDiv").hide();
            }
            else
                $("#BusGridBusGuideMiscDifferenceDiv").show();
        }
        if (BusModel[0].OperationBusGuideStepOnDifferenceView) {
            if (BusModel[0].ViewBusGuideStepOnDifference == true) {
                BuscolumnHeaders.push($("#BusGuideStepOnDifferenceDiv").html());
                BusModel[0].OperationBusGuideStepOnDifferenceEdit ? Buscolumns.push({ data: "BusGuideStepOnDifference", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideStepOnDifference", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusGuideStepOnDifferenceLineNo);
                $("#BusGridBusGuideStepOnDifferenceDiv").hide();
            }
            else
                $("#BusGridBusGuideStepOnDifferenceDiv").show();
        }
        if (BusModel[0].OperationBusBusDifferenceView) {
            if (BusModel[0].ViewBusBusDifference == true) {
                BuscolumnHeaders.push($("#BusBusDifferenceDiv").html());
                BusModel[0].OperationBusBusDifferenceEdit ? Buscolumns.push({ data: "BusBusDifference", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusBusDifference", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusBusDifferenceLineNo);
                $("#BusGridBusBusDifferenceDiv").hide();
            }
            else
                $("#BusGridBusBusDifferenceDiv").show();
        }
        //
        if (BusModel[0].OperationBusStartView) {
            if (BusModel[0].ViewBusStart == true) {
                BuscolumnHeaders.push($("#BusStartDiv").html());
                BusModel[0].OperationBusStartEdit ? Buscolumns.push({ data: "BusStart", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusStart", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusStartLineNo);
                $("#BusGridBusStartDiv").hide();
            }
            else
                $("#BusGridBusStartDiv").show();
        }
        if (BusModel[0].OperationBusTimeView) {
            if (BusModel[0].ViewBusTime == true) {
                BuscolumnHeaders.push($("#BusTimeDiv").html());
                BusModel[0].OperationBusTimeEdit ? Buscolumns.push({ data: "BusTime", type: "time" }) : Buscolumns.push({ data: "BusTime", type: "time", readOnly: true });
                BuscolWidth.push(80);
                BuscolOrder.push(BusModel[0].OperationBusTimeLineNo);
                $("#BusGridBusTimeDiv").hide();
            }
            else
                $("#BusGridBusTimeDiv").show();
        }
        //
        if (BusModel[0].OperationBusServiceDateView) {
            if (BusModel[0].ViewBusDateOfService == true) {
                BuscolumnHeaders.push($("#BusDateOfServiceDiv").html());
                BusModel[0].OperationBusServiceDateEdit ? Buscolumns.push({ data: "BusDateOfService", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusDateOfService", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(160);
                BuscolOrder.push(BusModel[0].OperationBusServiceDateLineNo);
                $("#BusGridBusDateOfServiceDiv").hide();
            }
            else
                $("#BusGridBusDateOfServiceDiv").show();
        }
        //
        if (BusModel[0].OperationBusStartCityView) {
            if (BusModel[0].ViewBusStartCity == true) {
                BuscolumnHeaders.push($("#BusStartCityDiv").html());
                BusModel[0].OperationBusStartCityEdit ? Buscolumns.push({ data: "BusStartCity", type: "text" }) : Buscolumns.push({ data: "BusStartCity", type: "text", readOnly: true });
                BuscolWidth.push(160);
                BuscolOrder.push(BusModel[0].OperationBusStartCityLineNo);
                $("#BusGridBusStartCityDiv").hide();
            }
            else
                $("#BusGridBusStartCityDiv").show();
        }
        //
        if (BusModel[0].OperationBusEndCityView) {
            if (BusModel[0].ViewBusEndCity == true) {
                BuscolumnHeaders.push($("#BusEndCityDiv").html());
                BusModel[0].OperationBusEndCityEdit ? Buscolumns.push({ data: "BusEndCity", type: "text" }) : Buscolumns.push({ data: "BusEndCity", type: "text", readOnly: true });
                BuscolWidth.push(160);
                BuscolOrder.push(BusModel[0].OperationBusEndCityLineNo);
                $("#BusGridBusEndCityDiv").hide();
            }
            else
                $("#BusGridBusEndCityDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusCountView) {
            if (BusModel[0].ViewBusBusCount == true) {
                BuscolumnHeaders.push($("#BusBusCountDiv").html());
                BusModel[0].OperationBusBusCountEdit ? Buscolumns.push({ data: "BusBusCount", type: "numeric" }) : Buscolumns.push({ data: "BusBusCount", type: "numeric", readOnly: true });
                BuscolWidth.push(120);
                BuscolOrder.push(BusModel[0].OperationBusBusCountLineNo);
                $("#BusGridBusBusCountDiv").hide();
            }
            else
                $("#BusGridBusBusCountDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusSizeView) {
            if (BusModel[0].ViewBusBusSize == true) {
                BuscolumnHeaders.push($("#BusBusSizeDiv").html());
                BusModel[0].OperationBusBusSizeEdit ? Buscolumns.push({ data: "BusBusSize", type: "numeric" }) : Buscolumns.push({ data: "BusBusSize", type: "numeric", readOnly: true });
                BuscolWidth.push(120);
                BuscolOrder.push(BusModel[0].OperationBusBusSizeLineNo);
                $("#BusGridBusBusSizeDiv").hide();
            }
            else
                $("#BusGridBusBusSizeDiv").show();
        }
        ////
        //if (BusModel[0].OperationBusServiceCodeView) {
        //    if (BusModel[0].ViewBusServiceCode == true) {
        //        BuscolumnHeaders.push($("#BusServiceCodeDiv").html());
        //        BusModel[0].OperationBusServiceCodeEdit ? Buscolumns.push({ data: "BusServiceCode", type: "text" }) : Buscolumns.push({ data: "BusServiceCode", type: "text", readOnly: true });
        //        BuscolWidth.push(150);
        //        BuscolOrder.push(BusModel[0].OperationBusServiceCodeLineNo);
        //        $("#BusGridBusServiceCodeDiv").hide();
        //    }
        //    else
        //        $("#BusGridBusServiceCodeDiv").show();
        //}
        ////
        if (BusModel[0].OperationBusServiceDetailView) {
            if (BusModel[0].ViewBusServiceDetail == true) {
                BuscolumnHeaders.push($("#BusServiceDetailDiv").html());
                BusModel[0].OperationBusServiceDetailEdit ? Buscolumns.push({ data: "BusSelectedDetail", type: "dropdown"}) : Buscolumns.push({ data: "BusSelectedDetail", type: "dropdown", readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusServiceDetailLineNo);
                $("#BusGridBusServiceDetailDiv").hide();
            }
            else
                $("#BusGridBusServiceDetailDiv").show();
        }
        //
        if (BusModel[0].OperationBusServiceDetailView) {
            if (BusModel[0].ViewBusServiceDetail == true) {
                BuscolumnHeaders.push($("#BusServiceDiv").html());
                BusModel[0].OperationBusServiceDetailEdit ? Buscolumns.push({ data: "BusSelectedService", type: "dropdown", source: BusServicedrop }) : Buscolumns.push({ data: "BusSelectedService", type: "dropdown", source: BusServicedrop, readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusServiceDetailLineNo);
                $("#BusGridBusServiceDiv").hide();
            }
            else
                $("#BusGridBusServiceDiv").show();
        }
        ////
        if (BusModel[0].OperationBusEmployeeView) {
            if (BusModel[0].ViewBusEmployee == true) {
                BuscolumnHeaders.push($("#BusEmployeeDiv").html());
                BusModel[0].OperationBusEmployeeEdit ? Buscolumns.push({ data: "BusSelectedEmployee", type: "dropdown", source: BusEmpdrop }) : Buscolumns.push({ data: "BusSelectedEmployee", type: "dropdown", source: BusEmpdrop, readOnly: true });
                BuscolWidth.push(200);
                BuscolOrder.push(BusModel[0].OperationBusEmployeeLineNo);
                $("#BusGridBusEmployeeDiv").hide();
            }
            else
                $("#BusGridBusEmployeeDiv").show();
        }

        if (BusModel[0].OperationBusSupplierView) {
            if (BusModel[0].ViewBusSupplier == true) {
                BuscolumnHeaders.push($("#BusSupplierDiv").html());
                BusModel[0].OperationBusSupplierEdit ? Buscolumns.push({ data: "BusSupplier", type: "autocomplete", source: BusVendorNamedrop, strict: false }) : Buscolumns.push({ data: "BusSupplier", type: "autocomplete", source: BusVendorNamedrop, strict: false, readOnly: true });
                BuscolWidth.push(300);
                BuscolOrder.push(BusModel[0].OperationBusSupplierLineNo);
                $("#BusGridBusSupplierDiv").hide();
            }
            else
                $("#BusGridBusSupplierDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideView) {
            if (BusModel[0].ViewBusGuide == true) {
                BuscolumnHeaders.push($("#BusGuideDiv").html());
                BusModel[0].OperationBusGuideEdit ? Buscolumns.push({ data: "BusGuide", type: "autocomplete", source: BusGuideNamedrop, strict: false }) : Buscolumns.push({ data: "BusGuide", type: "autocomplete", source: BusGuideNamedrop, strict: false, readOnly: true });
                BuscolWidth.push(300);
                BuscolOrder.push(BusModel[0].OperationBusGuideLineNo);
                $("#BusGridBusGuideDiv").hide();
            }
            else
                $("#BusGridBusGuideDiv").show();
        }
        //
        if (BusModel[0].OperationBusAirportView) {
            if (BusModel[0].ViewBusAirport == true) {
                BuscolumnHeaders.push($("#BusAirportDiv").html());
                BusModel[0].OperationBusAirportEdit ? Buscolumns.push({ data: "BusAirport", type: "text" }) : Buscolumns.push({ data: "BusAirport", type: "text", readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusAirportLineNo);
                $("#BusGridBusAirportDiv").hide();
            }
            else
                $("#BusGridBusAirportDiv").show();
        }
        if (BusModel[0].OperationBusViewGroupContractView) {
            BuscolumnHeaders.push($("#BusGroupContractHtmlDiv").html());
            Buscolumns.push({ data: "BusGroupContractHtml", renderer: "html" });
            BuscolWidth.push(150);
            BuscolOrder.push(BusModel[0].OperationBusViewGroupContractLineNo);
        }
        //
        if (BusModel[0].OperationBusStatusView) {
            if (BusModel[0].ViewBusStatus == true) {
                BuscolumnHeaders.push($("#BusStatusDiv").html());
                BusModel[0].OperationBusStatusEdit ? Buscolumns.push({ data: "BusStatus", type: "dropdown", source: BusVnStatusDrop }) : Buscolumns.push({ data: "BusStatus", type: "dropdown", source: BusVnStatusDrop, readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusStatusLineNo);
                $("#BusGridBusStatusDiv").hide();
            }
            else
                $("#BusGridBusStatusDiv").show();
        }
        ////
        //if (BusModel[0].OperationBusConfirmationView) {
        //    if (BusModel[0].ViewBusConfirmation == true) {
        //        BuscolumnHeaders.push($("#BusConfirmationDiv").html());
        //        BusModel[0].OperationBusConfirmationEdit ? Buscolumns.push({ data: "BusConfirmation", type: "dropdown", source: BusStatusDrop }) : Buscolumns.push({ data: "BusConfirmation", type: "dropdown", source: BusStatusDrop, readOnly: true });
        //        BuscolWidth.push(140);
        //        BuscolOrder.push(BusModel[0].OperationBusConfirmationLineNo);
        //        $("#BusGridBusConfirmationDiv").hide();
        //    }
        //    else
        //        $("#BusGridBusConfirmationDiv").show();
        //}
        //
        if (BusModel[0].OperationBusGuideSalaryView) {
            if (BusModel[0].ViewBusGuideSalary == true) {
                BuscolumnHeaders.push($("#BusGuideSalaryDiv").html());
                BusModel[0].OperationBusGuideSalaryEdit ? Buscolumns.push({ data: "BusGuideSalary", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideSalary", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusGuideSalaryLineNo);
                $("#BusGridBusGuideSalaryDiv").hide();
            }
            else
                $("#BusGridBusGuideSalaryDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideMiscView) {
            if (BusModel[0].ViewBusGuideMisc == true) {
                BuscolumnHeaders.push($("#BusGuideMiscDiv").html());
                BusModel[0].OperationBusGuideMiscEdit ? Buscolumns.push({ data: "BusGuideMisc", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideMisc", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusGuideMiscLineNo);
                $("#BusGridBusGuideMiscDiv").hide();
            }
            else
                $("#BusGridBusGuideMiscDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideStepOnView) {
            if (BusModel[0].ViewBusGuideStepOn == true) {
                BuscolumnHeaders.push($("#BusGuideStepOnDiv").html());
                BusModel[0].OperationBusGuideStepOnEdit ? Buscolumns.push({ data: "BusGuideStepOn", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideStepOn", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(140);
                BuscolOrder.push(BusModel[0].OperationBusGuideStepOnLineNo);
                $("#BusGridBusGuideStepOnDiv").hide();
            }
            else
                $("#BusGridBusGuideStepOnDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideSalaryPaidView) {
            if (BusModel[0].ViewBusGuideSalaryPaid == true) {
                BuscolumnHeaders.push($("#BusGuideSalaryPaidDiv").html());
                BusModel[0].OperationBusGuideSalaryPaidEdit ? Buscolumns.push({ data: "BusGuideSalaryPaid", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideSalaryPaid", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(170);
                BuscolOrder.push(BusModel[0].OperationBusGuideSalaryPaidLineNo);
                $("#BusGridBusGuideSalaryPaidDiv").hide();
            }
            else
                $("#BusGridBusGuideSalaryPaidDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideAdditionalChargesView) {
            if (BusModel[0].ViewBusGuideAdditionalCharges == true) {
                BuscolumnHeaders.push($("#BusGuideAdditionalChargesDiv").html());
                BusModel[0].OperationBusGuideAdditionalChargesEdit ? Buscolumns.push({ data: "BusGuideAdditionalCharges", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideAdditionalCharges", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusGuideAdditionalChargesLineNo);
                $("#BusGridBusGuideAdditionalChargesDiv").hide();
            }
            else
                $("#BusGridBusGuideAdditionalChargesDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideSalaryInvoicePaidView) {
            if (BusModel[0].ViewBusGuideSalaryInvoicePaid == true) {
                BuscolumnHeaders.push($("#BusGuideSalaryInvoicePaidDiv").html());
                BusModel[0].OperationBusGuideSalaryInvoicePaidEdit ? Buscolumns.push({ data: "BusGuideSalaryInvoicePaid", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideSalaryInvoicePaid", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(160);
                BuscolOrder.push(BusModel[0].OperationBusGuideSalaryInvoicePaidLineNo);
                $("#BusGridBusGuideSalaryInvoicePaidDiv").hide();
            }
            else
                $("#BusGridBusGuideSalaryInvoicePaidDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideTotalCostView) {
            if (BusModel[0].ViewBusGuideTotalCost == true) {
                BuscolumnHeaders.push($("#BusGuideTotalCostDiv").html());
                BusModel[0].OperationBusGuideTotalCostEdit ? Buscolumns.push({ data: "BusGuideTotalCost", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideTotalCost", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusGuideTotalCostLineNo);
                $("#BusGridBusGuideTotalCostDiv").hide();
            }
            else
                $("#BusGridBusGuideTotalCostDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusTotalCostView) {
            if (BusModel[0].ViewBusBusTotalCost == true) {
                BuscolumnHeaders.push($("#BusBusTotalCostDiv").html());
                BusModel[0].OperationBusBusTotalCostEdit ? Buscolumns.push({ data: "BusBusTotalCost", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusBusTotalCost", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusBusTotalCostLineNo);
                $("#BusGridBusBusTotalCostDiv").hide();
            }
            else
                $("#BusGridBusBusTotalCostDiv").show();
        }
        //
        if (BusModel[0].OperationBusPriceView) {
            if (BusModel[0].ViewBusPrice == true) {
                BuscolumnHeaders.push($("#BusPriceDiv").html());
                BusModel[0].OperationBusPriceEdit ? Buscolumns.push({ data: "BusPrice", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusPrice", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(120);
                BuscolOrder.push(BusModel[0].OperationBusPriceLineNo);
                $("#BusGridBusPriceDiv").hide();
            }
            else
                $("#BusGridBusPriceDiv").show();
        }
        if (BusModel[0].OperationBusBusCurrencyView) {
            if (BusModel[0].ViewBusBusCurrency == true) {
                BuscolumnHeaders.push($("#BusBusCurrencyDiv").html());
                BusModel[0].OperationBusBusCurrencyEdit ? Buscolumns.push({ data: "BusQuotaBusCurr", type: "dropdown", source: BusCurrencydrop }) : Buscolumns.push({ data: "BusQuotaBusCurr", type: "dropdown", source: BusCurrencydrop, readOnly: true });
                BuscolWidth.push(120);
                BuscolOrder.push(BusModel[0].OperationBusBusCurrencyLineNo);
                $("#BusGridBusBusCurrencyDiv").hide();
            }
            else
                $("#BusGridBusBusCurrencyDiv").show();
        }
        //
        if (BusModel[0].OperationBusQuotaBusPriceView) {
            if (BusModel[0].ViewBusQuotaBusPrice == true) {
                BuscolumnHeaders.push($("#BusQuotaBusPriceDiv").html());
                BusModel[0].OperationBusQuotaBusPriceEdit ? Buscolumns.push({ data: "BusQuotaBusPrice", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusQuotaBusPrice", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(150);
                BuscolOrder.push(BusModel[0].OperationBusQuotaBusPriceLineNo);
                $("#BusGridBusQuotaBusPriceDiv").hide();
            }
            else
                $("#BusGridBusQuotaBusPriceDiv").show();
        }
        //
        if (BusModel[0].OperationBusQuotaSupplierView) {
            if (BusModel[0].ViewBusQuotaSupplier == true) {
                BuscolumnHeaders.push($("#BusQuotaSupplierDiv").html());
                BusModel[0].OperationBusQuotaSupplierEdit ? Buscolumns.push({ data: "BusQuotaSupplier", type: "text" }) : Buscolumns.push({ data: "BusQuotaSupplier", type: "text", readOnly: true });
                BuscolWidth.push(300);
                BuscolOrder.push(BusModel[0].OperationBusQuotaSupplierLineNo);
                $("#BusGridBusQuotaSupplierDiv").hide();
            }
            else
                $("#BusGridBusQuotaSupplierDiv").show();
        }
        if (BusModel[0].OperationBusGuideCurrencyView) {
            if (BusModel[0].ViewBusGuideCurrency == true) {
                BuscolumnHeaders.push($("#BusGuideCurrencyDiv").html());
                BusModel[0].OperationBusGuideCurrencyEdit ? Buscolumns.push({ data: "BusQuotaGuideCurr", type: "dropdown", source: BusCurrencydrop }) : Buscolumns.push({ data: "BusQuotaGuideCurr", type: "dropdown", source: BusCurrencydrop, readOnly: true });
                BuscolWidth.push(130);
                BuscolOrder.push(BusModel[0].OperationBusGuideCurrencyLineNo);
                $("#BusGridBusGuideCurrencyDiv").hide();
            }
            else
                $("#BusGridBusGuideCurrencyDiv").show();
        }
        //
        if (BusModel[0].OperationBusQuotaGuideSalaryView) {
            if (BusModel[0].ViewBusQuotaGuideSalary == true) {
                BuscolumnHeaders.push($("#BusQuotaGuideSalaryDiv").html());
                BusModel[0].OperationBusQuotaGuideSalaryEdit ? Buscolumns.push({ data: "BusQuotaGuideSalary", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusQuotaGuideSalary", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(190);
                BuscolOrder.push(BusModel[0].OperationBusQuotaGuideSalaryLineNo);
                $("#BusGridBusQuotaGuideSalaryDiv").hide();
            }
            else
                $("#BusGridBusQuotaGuideSalaryDiv").show();
        }
        //
        if (BusModel[0].OperationBusQuotaGuideMiscView) {
            if (BusModel[0].ViewBusQuotaGuideMisc == true) {
                BuscolumnHeaders.push($("#BusQuotaGuideMiscDiv").html());
                BusModel[0].OperationBusQuotaGuideMiscEdit ? Buscolumns.push({ data: "BusQuotaGuideMisc", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusQuotaGuideMisc", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(190);
                BuscolOrder.push(BusModel[0].OperationBusQuotaGuideMiscLineNo);
                $("#BusGridBusQuotaGuideMiscDiv").hide();
            }
            else
                $("#BusGridBusQuotaGuideMiscDiv").show();
        }
        //
        if (BusModel[0].OperationBusQuotaGuideStepOnView) {
            if (BusModel[0].ViewBusQuotaGuideStepOn == true) {
                BuscolumnHeaders.push($("#BusQuotaGuideStepOnDiv").html());
                BusModel[0].OperationBusQuotaGuideStepOnEdit ? Buscolumns.push({ data: "BusQuotaGuideStepOn", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusQuotaGuideStepOn", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(190);
                BuscolOrder.push(BusModel[0].OperationBusQuotaGuideStepOnLineNo);
                $("#BusGridBusQuotaGuideStepOnDiv").hide();
            }
            else
                $("#BusGridBusQuotaGuideStepOnDiv").show();
        }
        //
        if (BusModel[0].OperationBusQuotaGuideView) {
            if (BusModel[0].ViewBusQuotaGuide == true) {
                BuscolumnHeaders.push($("#BusQuotaGuideDiv").html());
                BusModel[0].OperationBusQuotaGuideEdit ? Buscolumns.push({ data: "BusQuotaGuide", type: "text" }) : Buscolumns.push({ data: "BusQuotaGuide", type: "text", readOnly: true });
                BuscolWidth.push(300);
                BuscolOrder.push(BusModel[0].OperationBusQuotaGuideLineNo);
                $("#BusGridBusQuotaGuideDiv").hide();
            }
            else
                $("#BusGridBusQuotaGuideDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusFirstPaymentView) {
            if (BusModel[0].ViewBusFirstPayment == true) {
                BuscolumnHeaders.push($("#BusFirstPaymentDiv").html());
                BusModel[0].OperationBusBusFirstPaymentEdit ? Buscolumns.push({ data: "BusFirstPayment", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusFirstPayment", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(160);
                BuscolOrder.push(BusModel[0].OperationBusBusFirstPaymentLineNo);
                $("#BusGridBusFirstPaymentDiv").hide();
            }
            else
                $("#BusGridBusFirstPaymentDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusFirstPaymentMethodView) {
            if (BusModel[0].ViewBusSelectedFirstPaymentMethod == true) {
                BuscolumnHeaders.push($("#BusFirstPaymentMethodDiv").html());
                BusModel[0].OperationBusBusFirstPaymentMethodEdit ? Buscolumns.push({ data: "BusSelectedFirstPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop }) : Buscolumns.push({ data: "BusSelectedFirstPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop, readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusBusFirstPaymentMethodLineNo);
                $("#BusGridBusFirstPaymentMethodDiv").hide();
            }
            else
                $("#BusGridBusFirstPaymentMethodDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusFirstPaymentDetailsView) {
            BuscolumnHeaders.push($("#BusPayMeth1FormHtmlDiv").html());
            Buscolumns.push({ data: "BusPayMeth1FormHtml", renderer: "html" });
            BuscolWidth.push(160);
            BuscolOrder.push(BusModel[0].OperationBusBusFirstPaymentDetailsLineNo);
        }
        //
        if (BusModel[0].OperationBusBusDateofFirstPaymentView) {
            if (BusModel[0].ViewBusDateFirstPayment == true) {
                BuscolumnHeaders.push($("#BusDateFirstPaymentDiv").html());
                BusModel[0].OperationBusBusDateofFirstPaymentEdit ? Buscolumns.push({ data: "BusDateFirstPayment", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusDateFirstPayment", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusBusDateofFirstPaymentLineNo);
                $("#BusGridBusDateFirstPaymentDiv").hide();
            }
            else
                $("#BusGridBusDateFirstPaymentDiv").show();
        }
        //
        //
        if (BusModel[0].OperationBusBusSecondPaymentView) {
            if (BusModel[0].ViewBusSecondPayment == true) {
                BuscolumnHeaders.push($("#BusSecondPaymentDiv").html());
                BusModel[0].OperationBusBusSecondPaymentEdit ? Buscolumns.push({ data: "BusSecondPayment", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusSecondPayment", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(160);
                BuscolOrder.push(BusModel[0].OperationBusBusSecondPaymentLineNo);
                $("#BusGridBusSecondPaymentDiv").hide();
            }
            else
                $("#BusGridBusSecondPaymentDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusSecondPaymentMethodView) {
            if (BusModel[0].ViewBusSelectedSecondPaymentMethod == true) {
                BuscolumnHeaders.push($("#BusSecondPaymentMethodDiv").html());
                BusModel[0].OperationBusBusSecondPaymentMethodEdit ? Buscolumns.push({ data: "BusSelectedSecondPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop }) : Buscolumns.push({ data: "BusSelectedSecondPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop, readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusBusSecondPaymentMethodLineNo);
                $("#BusGridBusSecondPaymentMethodDiv").hide();
            }
            else
                $("#BusGridBusSecondPaymentMethodDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusSecondPaymentDetailsView) {
            BuscolumnHeaders.push($("#BusPayMeth2FormHtmlDiv").html());
            Buscolumns.push({ data: "BusPayMeth2FormHtml", renderer: "html" });
            BuscolWidth.push(160);
            BuscolOrder.push(BusModel[0].OperationBusBusSecondPaymentDetailsLineNo);
        }
        //
        if (BusModel[0].OperationBusBusDateofSecondPaymentView) {
            if (BusModel[0].ViewBusDateSecondPayment == true) {
                BuscolumnHeaders.push($("#BusDateSecondPaymentDiv").html());
                BusModel[0].OperationBusBusDateofSecondPaymentEdit ? Buscolumns.push({ data: "BusDateSecondPayment", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusDateSecondPayment", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusBusDateofSecondPaymentLineNo);
                $("#BusGridBusDateSecondPaymentDiv").hide();
            }
            else
                $("#BusGridBusDateSecondPaymentDiv").show();
        }
        //
        //
        if (BusModel[0].OperationBusBusThirdPaymentView) {
            if (BusModel[0].ViewBusThirdPayment == true) {
                BuscolumnHeaders.push($("#BusThirdPaymentDiv").html());
                BusModel[0].OperationBusBusThirdPaymentEdit ? Buscolumns.push({ data: "BusThirdPayment", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusThirdPayment", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(160);
                BuscolOrder.push(BusModel[0].OperationBusBusThirdPaymentLineNo);
                $("#BusGridBusThirdPaymentDiv").hide();
            }
            else
                $("#BusGridBusThirdPaymentDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusThirdPaymentMethodView) {
            if (BusModel[0].ViewBusSelectedThirdPaymentMethod == true) {
                BuscolumnHeaders.push($("#BusThirdPaymentMethodDiv").html());
                BusModel[0].OperationBusBusThirdPaymentMethodEdit ? Buscolumns.push({ data: "BusSelectedThirdPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop }) : Buscolumns.push({ data: "BusSelectedThirdPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop, readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusBusThirdPaymentMethodLineNo);
                $("#BusGridBusThirdPaymentMethodDiv").hide();
            }
            else
                $("#BusGridBusThirdPaymentMethodDiv").show();
        }
        //
        if (BusModel[0].OperationBusBusThirdPaymentDetailsView) {
            BuscolumnHeaders.push($("#BusPayMeth3FormHtmlDiv").html());
            Buscolumns.push({ data: "BusPayMeth3FormHtml", renderer: "html" });
            BuscolWidth.push(160);
            BuscolOrder.push(BusModel[0].OperationBusBusThirdPaymentDetailsLineNo);
        }
        //
        if (BusModel[0].OperationBusBusDateofThirdPaymentView) {
            if (BusModel[0].ViewBusDateThirdPayment == true) {
                BuscolumnHeaders.push($("#BusDateThirdPaymentDiv").html());
                BusModel[0].OperationBusBusDateofThirdPaymentEdit ? Buscolumns.push({ data: "BusDateThirdPayment", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusDateThirdPayment", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(220);
                BuscolOrder.push(BusModel[0].OperationBusBusDateofThirdPaymentLineNo);
                $("#BusGridBusDateThirdPaymentDiv").hide();
            }
            else
                $("#BusGridBusDateThirdPaymentDiv").show();
        }
        //
        //
        if (BusModel[0].OperationBusGuideFirstPaymentView) {
            if (BusModel[0].ViewBusGuideFirstPayment == true) {
                BuscolumnHeaders.push($("#BusGuideFirstPaymentDiv").html());
                BusModel[0].OperationBusGuideFirstPaymentEdit ? Buscolumns.push({ data: "BusGuideFirstPayment", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideFirstPayment", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(170);
                BuscolOrder.push(BusModel[0].OperationBusGuideFirstPaymentLineNo);
                $("#BusGridBusGuideFirstPaymentDiv").hide();
            }
            else
                $("#BusGridBusGuideFirstPaymentDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideFirstPaymentMethodView) {
            if (BusModel[0].ViewBusGuideSelectedFirstPaymentMethod == true) {
                BuscolumnHeaders.push($("#BusGuideFirstPaymentMethodDiv").html());
                BusModel[0].OperationBusGuideFirstPaymentMethodEdit ? Buscolumns.push({ data: "BusGuideSelectedFirstPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop }) : Buscolumns.push({ data: "BusGuideSelectedFirstPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop, readOnly: true });
                BuscolWidth.push(230);
                BuscolOrder.push(BusModel[0].OperationBusGuideFirstPaymentMethodLineNo);
                $("#BusGridBusGuideFirstPaymentMethodDiv").hide();
            }
            else
                $("#BusGridBusGuideFirstPaymentMethodDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideFirstPaymentDetailsView) {
            BuscolumnHeaders.push($("#BusGuidePayMeth1FormHtmlDiv").html());
            Buscolumns.push({ data: "GuidePayMeth1FormHtml", renderer: "html" });
            BuscolWidth.push(170);
            BuscolOrder.push(BusModel[0].OperationBusGuideFirstPaymentDetailsLineNo);
        }
        //
        if (BusModel[0].OperationBusGuideDateofFirstPaymentView) {
            if (BusModel[0].ViewBusGuideDateFirstPayment == true) {
                BuscolumnHeaders.push($("#BusGuideDateFirstPaymentDiv").html());
                BusModel[0].OperationBusGuideDateofFirstPaymentEdit ? Buscolumns.push({ data: "BusGuideDateFirstPayment", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusGuideDateFirstPayment", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(230);
                BuscolOrder.push(BusModel[0].OperationBusGuideDateofFirstPaymentLineNo);
                $("#BusGridBusGuideDateFirstPaymentDiv").hide();
            }
            else
                $("#BusGridBusGuideDateFirstPaymentDiv").show();
        }
        //
        //
        if (BusModel[0].OperationBusGuideSecondPaymentView) {
            if (BusModel[0].ViewBusGuideSecondPayment == true) {
                BuscolumnHeaders.push($("#BusGuideSecondPaymentDiv").html());
                BusModel[0].OperationBusGuideSecondPaymentEdit ? Buscolumns.push({ data: "BusGuideSecondPayment", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideSecondPayment", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(170);
                BuscolOrder.push(BusModel[0].OperationBusGuideSecondPaymentLineNo);
                $("#BusGridBusGuideSecondPaymentDiv").hide();
            }
            else
                $("#BusGridBusGuideSecondPaymentDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideSecondPaymentMethodView) {
            if (BusModel[0].ViewBusGuideSelectedSecondPaymentMethod == true) {
                BuscolumnHeaders.push($("#BusGuideSecondPaymentMethodDiv").html());
                BusModel[0].OperationBusGuideSecondPaymentMethodEdit ? Buscolumns.push({ data: "BusGuideSelectedSecondPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop }) : Buscolumns.push({ data: "BusGuideSelectedSecondPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop, readOnly: true });
                BuscolWidth.push(230);
                BuscolOrder.push(BusModel[0].OperationBusGuideSecondPaymentMethodLineNo);
                $("#BusGridBusGuideSecondPaymentMethodDiv").hide();
            }
            else
                $("#BusGridBusGuideSecondPaymentMethodDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideSecondPaymentDetailsView) {
            BuscolumnHeaders.push($("#BusGuidePayMeth2FormHtmlDiv").html());
            Buscolumns.push({ data: "GuidePayMeth2FormHtml", renderer: "html" });
            BuscolWidth.push(170);
            BuscolOrder.push(BusModel[0].OperationBusGuideSecondPaymentDetailsLineNo);
        }
        //
        if (BusModel[0].OperationBusGuideDateofSecondPaymentView) {
            if (BusModel[0].ViewBusGuideDateSecondPayment == true) {
                BuscolumnHeaders.push($("#BusGuideDateSecondPaymentDiv").html());
                BusModel[0].OperationBusGuideDateofSecondPaymentEdit ? Buscolumns.push({ data: "BusGuideDateSecondPayment", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusGuideDateSecondPayment", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(230);
                BuscolOrder.push(BusModel[0].OperationBusGuideDateofSecondPaymentLineNo);
                $("#BusGridBusGuideDateSecondPaymentDiv").hide();
            }
            else
                $("#BusGridBusGuideDateSecondPaymentDiv").show();
        }
        //
        //
        if (BusModel[0].OperationBusGuideThirdPaymentView) {
            if (BusModel[0].ViewBusGuideThirdPayment == true) {
                BuscolumnHeaders.push($("#BusGuideThirdPaymentDiv").html());
                BusModel[0].OperationBusGuideThirdPaymentEdit ? Buscolumns.push({ data: "BusGuideThirdPayment", type: "numeric", format: '$0,0.00' }) : Buscolumns.push({ data: "BusGuideThirdPayment", type: "numeric", format: '$0,0.00', readOnly: true });
                BuscolWidth.push(170);
                BuscolOrder.push(BusModel[0].OperationBusGuideThirdPaymentLineNo);
                $("#BusGridBusGuideThirdPaymentDiv").hide();
            }
            else
                $("#BusGridBusGuideThirdPaymentDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideThirdPaymentMethodView) {
            if (BusModel[0].ViewBusGuideSelectedThirdPaymentMethod == true) {
                BuscolumnHeaders.push($("#BusGuideThirdPaymentMethodDiv").html());
                BusModel[0].OperationBusGuideThirdPaymentMethodEdit ? Buscolumns.push({ data: "BusGuideSelectedThirdPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop }) : Buscolumns.push({ data: "BusGuideSelectedThirdPaymentMethod", type: "dropdown", source: BusPaymentMethoddrop, readOnly: true });
                BuscolWidth.push(230);
                BuscolOrder.push(BusModel[0].OperationBusGuideThirdPaymentMethodLineNo);
                $("#BusGridBusGuideThirdPaymentMethodDiv").hide();
            }
            else
                $("#BusGridBusGuideThirdPaymentMethodDiv").show();
        }
        //
        if (BusModel[0].OperationBusGuideThirdPaymentDetailsView) {
            BuscolumnHeaders.push($("#BusGuidePayMeth3FormHtmlDiv").html());
            Buscolumns.push({ data: "GuidePayMeth3FormHtml", renderer: "html" });
            BuscolWidth.push(170);
            BuscolOrder.push(BusModel[0].OperationBusGuideThirdPaymentDetailsLineNo);
        }
        //
        if (BusModel[0].OperationBusGuideDateofThirdPaymentView) {
            if (BusModel[0].ViewBusGuideDateThirdPayment == true) {
                BuscolumnHeaders.push($("#BusGuideDateThirdPaymentDiv").html());
                BusModel[0].OperationBusGuideDateofThirdPaymentEdit ? Buscolumns.push({ data: "BusGuideDateThirdPayment", type: "date", dateFormat: 'D, dd/M/yy' }) : Buscolumns.push({ data: "BusGuideDateThirdPayment", type: "date", dateFormat: 'D, dd/M/yy', readOnly: true });
                BuscolWidth.push(230);
                BuscolOrder.push(BusModel[0].OperationBusGuideDateofThirdPaymentLineNo);
                $("#BusGridBusGuideDateThirdPaymentDiv").hide();
            }
            else
                $("#BusGridBusGuideDateThirdPaymentDiv").show();
        }
        //
        if (BusModel[0].OperationBusNoteView) {
            if (BusModel[0].ViewBusNotes == true) {
                BuscolumnHeaders.push($("#BusNotesDiv").html());
                BusModel[0].OperationBusNoteEdit ? Buscolumns.push({ data: "BusNotes", type: "text" }) : Buscolumns.push({ data: "BusNotes", type: "text", readOnly: true });
                BuscolWidth.push(500);
                BuscolOrder.push(BusModel[0].OperationBusNoteLineNo);
                $("#BusGridBusNotesDiv").hide();
            }
            else
                $("#BusGridBusNotesDiv").show();
        }


        for (var ind1 = 0; ind1 < BuscolOrder.length; ind1++)
            for (var ind2 = ind1 + 1; ind2 < BuscolOrder.length; ind2++) {
                if (BuscolOrder[ind2] < BuscolOrder[ind1]) {
                    var ord = BuscolOrder[ind2];
                    BuscolOrder[ind2] = BuscolOrder[ind1];
                    BuscolOrder[ind1] = ord;
                    var Header = BuscolumnHeaders[ind2];
                    BuscolumnHeaders[ind2] = BuscolumnHeaders[ind1];
                    BuscolumnHeaders[ind1] = Header;
                    var Width = BuscolWidth[ind2];
                    BuscolWidth[ind2] = BuscolWidth[ind1];
                    BuscolWidth[ind1] = Width;
                    var Col = Buscolumns[ind2];
                    Buscolumns[ind2] = Buscolumns[ind1];
                    Buscolumns[ind1] = Col;
                }
            }
        BusRedColorRendererForNegative = function (instance, td, row, col, prop, value, cellProperties) {
            Handsontable.renderers.NumericRenderer.apply(this, arguments);
            td.style.color = 'red';
        };
        var Busdata = BusModel[0].Rows;
        var CopyRowStart = null;

        $('#OperBusGrid').handsontable({
            data: Busdata,
            minSpareRows: 1,
            colHeaders: BuscolumnHeaders,
            colWidths: BuscolWidth,
            contextMenu: false,
            manualColumnResize: true,
            manualRowResize: true,
            manualColumnMove: true,
            wordWrap: false,
            columns: Buscolumns,
            fixedColumnsLeft: BusModel[0].OperationBusFixedColumnCount,
            //  isEmptyRow: customIsEmptyRow,
            afterSelectionEnd: function (row1, column1, row2, column2) {
                SelectedBusGridData.length = 0;
                SelectedBusGridData.push(row1);
                SelectedBusGridData.push(row2);
                SelectedBusGridData.push(column1);
                SelectedBusGridData.push(column2);
                $("#BusGetSelected").removeAttr('disabled');
            },
            afterSelectionByProp: function (row1, prop1, row2, prop2) {
                if (prop1 == prop2 && prop1 == "BusSupplier" && this.getData()[row1].BusVendorID != null)
                    CopyRowStart = row1;
            },
            afterChange: function (data, source) {
                if (data != null) {
                    CheckOperBusDataChanges();
                    var instance = this;
                    if (data[0][1] == "BusSupplier" && instance.getData()[data[0][0]].BusStatus == "Made") {
                        jAlert("Bus with Made status can not be changed.", "Warning!");
                        instance.getData()[data[0][0]].BusSupplier = data[0][2];
                        instance.render();
                    }
                    $(data).each(function (index, elem) {
                        if (elem[1] == "BusGuide") {
                            var row = elem[0];
                            var GuideElem = BusGetGuideElemByGuideName(elem[3]);
                            BusGuideAutoCopyCols(instance, row, GuideElem, CopyRowStart);
                            //CopyRowStart++;
                        }
                        if (elem[1] == "BusTime") {
                            var row = elem[0];
                            instance.getData()[row].BusNewTime = elem[3];
                        }
                        if (elem[1] == "BusSupplier") {
                            var row = elem[0];
                            var VndElem = BusGetVendorElemByVendorName(elem[3]);
                            BusAutoCopyCols(instance, row, VndElem, CopyRowStart);
                            CopyRowStart++;
                        }
                        if (elem[1] == "BusStatus") {
                            var VndElem = BusGetVendorElemByVendorID(instance.getData()[elem[0]].BusVendorID);
                            if (VndElem.VendorIsFind && elem[3] != elem[2]) {
                                jAlert("Vendor status can't be changed", "Warning!");
                                instance.getData()[elem[0]].BusStatus = elem[2];
                            }
                        }
                    });
                    instance.render();
                    if (data[0][1] == "BusSelectedService") {
                        var instance = this;
                        var row = data[0][0];
                        var BusDetaildrop = [];
                        var CurServiceTypeID = 0;
                        $(BusModel[0].Services).each(function (index, elem) {
                            if (elem.ServiceCode == data[0][3])
                                CurServiceTypeID = elem.ServiceTypeID;
                        });
                        $(BusModel[0].Details).each(function (index, elem) {
                            if (elem.ServiceTypeID == CurServiceTypeID)
                                BusDetaildrop.push(elem.DetailCode);
                        });
                        var cellProp = instance.getCellMeta(row, "BusSelectedDetail");
                        cellProp.source = BusDetaildrop;
                        instance.render();
                    }
                }
            },
            cells: function (row, col, prop) {
                var Cellinstance = this;
                if (Cellinstance.renderer == Handsontable.renderers.NumericRenderer && Cellinstance.instance.getDataAtCell(row, col) < 0) {
                    Cellinstance.renderer = BusRedColorRendererForNegative;
                }
                var cellProperties = {};
                if (prop == "BusInvoicePrice") {
                    if (BusModel[0].OperationBusInvoicePriceEdit && BusModel[0].OperationBusIsInvoiceView) {
                        cellProperties.readOnly = !Cellinstance.instance.getData()[row].BusIsInvoice;
                        return cellProperties;
                    }
                }
                if (prop == "BusPax") {
                    if (BusModel[0].OperationBusPaxEdit && BusModel[0].OperationBusIsInvoiceView) {
                        cellProperties.readOnly = !Cellinstance.instance.getData()[row].BusIsInvoice;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideSalary") {
                    if (BusModel[0].OperationBusGuideSalaryEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideMisc") {
                    if (BusModel[0].OperationBusGuideMiscEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideStepOn") {
                    if (BusModel[0].OperationBusGuideStepOnEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideSalaryPaid") {
                    if (BusModel[0].OperationBusGuideSalaryPaidEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideAdditionalCharges") {
                    if (BusModel[0].OperationBusGuideAdditionalChargesEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideSalaryInvoicePaid") {
                    if (BusModel[0].OperationBusGuideSalaryInvoicePaidEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideFirstPayment") {
                    if (BusModel[0].OperationBusGuideFirstPaymentEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideSelectedFirstPaymentMethod") {
                    if (BusModel[0].OperationBusGuideFirstPaymentMethodEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideDateFirstPayment") {
                    if (BusModel[0].OperationBusGuideDateofFirstPaymentEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideSecondPayment") {
                    if (BusModel[0].OperationBusGuideSecondPaymentEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideSelectedSecondPaymentMethod") {
                    if (BusModel[0].OperationBusGuideSecondPaymentMethodEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideDateSecondPayment") {
                    if (BusModel[0].OperationBusGuideDateofSecondPaymentEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideThirdPayment") {
                    if (BusModel[0].OperationBusGuideThirdPaymentEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideSelectedThirdPaymentMethod") {
                    if (BusModel[0].OperationBusGuideThirdPaymentMethodEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusGuideDateThirdPayment") {
                    if (BusModel[0].OperationBusGuideDateofThirdPaymentEdit) {
                        if ((Cellinstance.instance.getData()[row].BusGuideID == 0 || Cellinstance.instance.getData()[row].BusGuideID == null) && (Cellinstance.instance.getData()[row].BusNewGuideID == "" || Cellinstance.instance.getData()[row].BusNewGuideID == null)) {
                            cellProperties.readOnly = true;
                        }
                        else
                            cellProperties.readOnly = false;
                        return cellProperties;
                    }
                }
                if (prop == "BusSelectedDetail") {
                    var BusDetaildrop = [];
                    var CurServiceTypeID = 0;
                    $(BusModel[0].Services).each(function (index, elem) {
                        if (elem.ServiceCode == Cellinstance.instance.getData()[row].BusSelectedService)
                            CurServiceTypeID = elem.ServiceTypeID;
                    });
                    $(BusModel[0].Details).each(function (index, elem) {
                        if (elem.ServiceTypeID == CurServiceTypeID)
                        BusDetaildrop.push(elem.DetailCode);
                    });
                    Cellinstance.source = BusDetaildrop;
                    return Cellinstance;
                }
            }
        });
        if ($("#IsRemoveBusFilterDivShow").val() == "True") {
            $("#BusRemoveFiltersDiv").show();
        }

    }
    function BusGetGuideElemByGuideName(GuideName) {
        var Gelem = null;
        $(BusModel[0].GuideInfo).each(function (index, elem) {
            if (elem.GuideName == GuideName)
                Gelem = elem;
        });
        return Gelem;
    }
    function BusGetVendorElemByVendorName(VndName) {
        var Velem = null;
        $(BusModel[0].VendorInfo).each(function (index, elem) {
            if (elem.VendorName == VndName)
                Velem = elem;
        });
        return Velem;
    }
    function BusGetGuideElemByGuideID(GuideID) {
        var Gelem = null;
        $(BusModel[0].GuideInfo).each(function (index, elem) {
            if (elem.GuideID == GuideID)
                Gelem = elem;
        });
        return Gelem;
    }
    function BusGetVendorElemByVendorID(VendorID) {
        var Velem = null;
        $(BusModel[0].VendorInfo).each(function (index, elem) {
            if (elem.VendorID == VendorID)
                Velem = elem;
        });
        return Velem;
    }
    function BusGuideAutoCopyCols(instance, row, GuideElem, CopyRowStart) {
        debugger
        // Vendor Info auto copy
        instance.getData()[row].BusNewGuideID = GuideElem.GuideID;
        //if (instance.getData()[row].BusGroupID == null && CopyRowStart != null) {
        //    // new row
        //    instance.getData()[row].BusGroupID = instance.getData()[CopyRowStart].BusGroupID;
        //    instance.getData()[row].BusGroupCode = instance.getData()[CopyRowStart].BusGroupCode;
        //    instance.getData()[row].BusGroupName = instance.getData()[CopyRowStart].BusGroupName;
        //    instance.getData()[row].BusCustomer = instance.getData()[CopyRowStart].BusCustomer;
        //    instance.getData()[row].BusPax = instance.getData()[CopyRowStart].BusPax;
        //    instance.getData()[row].BusEstNoOfPerson = instance.getData()[CopyRowStart].BusEstNoOfPerson;
        //    instance.getData()[row].BusStatus = BusModel[0].VendorStatus[0].Text;
        //    instance.getData()[row].BusStart = instance.getData()[CopyRowStart].BusStart;
        //    instance.getData()[row].BusQuotaBusPrice = instance.getData()[CopyRowStart].BusQuotaBusPrice;
        //    instance.getData()[row].BusQuotaSupplier = instance.getData()[CopyRowStart].BusQuotaSupplier;
        //    instance.getData()[row].BusQuotaBusCurr = instance.getData()[CopyRowStart].BusQuotaBusCurr;
        //}

    }
    function BusAutoCopyCols(instance, row, VndElem, CopyRowStart) {
        debugger
        // Vendor Info auto copy
        instance.getData()[row].BusNewVendorID = VndElem.VendorID;
        if (instance.getData()[row].BusGroupID == null && CopyRowStart != null) {
            // new row
            instance.getData()[row].BusGroupID = instance.getData()[CopyRowStart].BusGroupID;
            instance.getData()[row].BusGroupCode = instance.getData()[CopyRowStart].BusGroupCode;
            instance.getData()[row].BusGroupName = instance.getData()[CopyRowStart].BusGroupName;
            instance.getData()[row].BusCustomer = instance.getData()[CopyRowStart].BusCustomer;
            instance.getData()[row].BusSelectedDetail = instance.getData()[CopyRowStart].BusSelectedDetail;
            instance.getData()[row].BusSelectedEmployee = instance.getData()[CopyRowStart].BusSelectedEmployee;
            instance.getData()[row].BusPax = instance.getData()[CopyRowStart].BusPax;
            instance.getData()[row].BusEstNoOfPerson = instance.getData()[CopyRowStart].BusEstNoOfPerson;
            instance.getData()[row].BusStatus = BusModel[0].VendorStatus[0].Text;
            instance.getData()[row].BusStart = instance.getData()[CopyRowStart].BusStart;
            instance.getData()[row].BusTime = instance.getData()[CopyRowStart].BusTime;
            instance.getData()[row].BusQuotaBusPrice = instance.getData()[CopyRowStart].BusQuotaBusPrice;
            instance.getData()[row].BusQuotaSupplier = instance.getData()[CopyRowStart].BusQuotaSupplier;
            instance.getData()[row].BusQuotaBusCurr = instance.getData()[CopyRowStart].BusQuotaBusCurr;
        }

    }
    function BusGetSelectedClick() {
        if ($("#BusForEmail").length > 0) {
            $("#BusForEmail").remove();
        }
        //get the instance using jQuery wrapper
        var SelectedBusGridDataHeaders = [];
        var SelectedBusElementValues = [];
        if (SelectedBusGridData[2] > SelectedBusGridData[3]) {
            var a = SelectedBusGridData[3];
            SelectedBusGridData[3] = SelectedBusGridData[2];
            SelectedBusGridData[2] = a;

        }
        if (SelectedBusGridData[0] > SelectedBusGridData[1]) {
            var a = SelectedBusGridData[0];
            SelectedBusGridData[0] = SelectedBusGridData[1];
            SelectedBusGridData[1] = a;

        }
        for (var ind = SelectedBusGridData[2]; ind <= SelectedBusGridData[3]; ++ind) {
            SelectedBusGridDataHeaders.push(($('#OperBusGrid').handsontable('getColHeader', ind)));
        }
        var hadstontabledata = $('#OperBusGrid').handsontable('getData', SelectedBusGridData[0], SelectedBusGridData[2], SelectedBusGridData[1], SelectedBusGridData[3]);
        $("#OperBusGridForm").append("<div id='BusForEmail' style='Display:None'></div>");

        var table = $('<table></table>');

        var Headercolumn = $("<tr style='border: 1px solid black;border-collapse: collapse'></tr>");
        for (i = 0; i < SelectedBusGridDataHeaders.length; i++) {
            var Headerrow = $("<td style='border: 1px solid black;border-collapse: collapse;background-color:red;color:white'></td>").html(SelectedBusGridDataHeaders[i]);
            Headercolumn.append(Headerrow);
            table.append(Headercolumn);
        }
        $(table).find('.BusGridFilterBtn').each(function () {
            $(this).remove();
        });
        $(table).find('.BusGridViewBtn').each(function () {
            $(this).remove();
        });
        $(table).find('input').each(function () {
            $(this).remove();
        });
        for (i = 0; i < hadstontabledata.length; i++) {
            var columntr = $("<tr style='border: 1px solid black;border-collapse: collapse'></tr>");
            for (j = 0; j < hadstontabledata[i].length; ++j) {
                var rowtd = $("<td style='border: 1px solid black;border-collapse: collapse'></td>").html(hadstontabledata[i][j]);
                columntr.append(rowtd)
            }
            table.append(columntr);
        }

        $('#BusForEmail').append(table);
    }
    // Bus Grid column Hide Unhide
    function BusGridColumnHideUnhide(element) {
        debugger
        var column = $(element).attr('id');
        switch (column) {
            case "BusGridBusIsInvoiceView":
                {
                    if (BusModel[0].ViewBusIsInvoice == true)
                        BusModel[0].ViewBusIsInvoice = false;
                    else
                        BusModel[0].ViewBusIsInvoice = true;
                }
                break;
            case "BusGridBusInvoicePriceView":
                {
                    if (BusModel[0].ViewBusInvoicePrice == true)
                        BusModel[0].ViewBusInvoicePrice = false;
                    else
                        BusModel[0].ViewBusInvoicePrice = true;
                }
                break;
            case "BusGridBusGroupNameView":
                {
                    if (BusModel[0].ViewBusGroupName == true)
                        BusModel[0].ViewBusGroupName = false;
                    else
                        BusModel[0].ViewBusGroupName = true;
                }
                break;
            case "BusGridBusGroupCodeView":
                {
                    if (BusModel[0].ViewBusGroupCode == true)
                        BusModel[0].ViewBusGroupCode = false;
                    else
                        BusModel[0].ViewBusGroupCode = true;
                }
                break;
            case "BusGridBusConfHtmlView":
                {
                    if (BusModel[0].ViewBusConfHtml == true)
                        BusModel[0].ViewBusConfHtml = false;
                    else
                        BusModel[0].ViewBusConfHtml = true;
                }
                break;
            case "BusGridBusCostView":
                {
                    if (BusModel[0].ViewBusCost == true)
                        BusModel[0].ViewBusCost = false;
                    else
                        BusModel[0].ViewBusCost = true;
                }
                break;
            case "BusGridBusGuideAdditionalChargesView":
                {
                    if (BusModel[0].ViewBusGuideAdditionalCharges == true)
                        BusModel[0].ViewBusGuideAdditionalCharges = false;
                    else
                        BusModel[0].ViewBusGuideAdditionalCharges = true;
                }
                break;
            case "BusGridBusGuideTotalPaidView":
                {
                    if (BusModel[0].ViewBusGuideTotalPaid == true)
                        BusModel[0].ViewBusGuideTotalPaid = false;
                    else
                        BusModel[0].ViewBusGuideTotalPaid = true;
                }
                break;
            case "BusGridBusBusTotalPaidView":
                {
                    if (BusModel[0].ViewBusBusTotalPaid == true)
                        BusModel[0].ViewBusBusTotalPaid = false;
                    else
                        BusModel[0].ViewBusBusTotalPaid = true;
                }
                break;
            case "BusGridBusGuideDifferenceView":
                {
                    if (BusModel[0].ViewBusGuideDifference == true)
                        BusModel[0].ViewBusGuideDifference = false;
                    else
                        BusModel[0].ViewBusGuideDifference = true;
                }
                break;
            case "BusGridBusGuideMiscDifferenceView":
                {
                    if (BusModel[0].ViewBusGuideMiscDifference == true)
                        BusModel[0].ViewBusGuideMiscDifference = false;
                    else
                        BusModel[0].ViewBusGuideMiscDifference = true;
                }
                break;
            case "BusGridBusGuideStepOnDifferenceView":
                {
                    if (BusModel[0].ViewBusGuideStepOnDifference == true)
                        BusModel[0].ViewBusGuideStepOnDifference = false;
                    else
                        BusModel[0].ViewBusGuideStepOnDifference = true;
                }
                break;
            case "BusGridBusBusDifferenceView":
                {
                    if (BusModel[0].ViewBusBusDifference == true)
                        BusModel[0].ViewBusBusDifference = false;
                    else
                        BusModel[0].ViewBusBusDifference = true;
                }
                break;
            case "BusGridBusStartView":
                {
                    if (BusModel[0].ViewBusStart == true)
                        BusModel[0].ViewBusStart = false;
                    else
                        BusModel[0].ViewBusStart = true;
                }
                break;
            case "BusGridBusTimeView":
                {
                    if (BusModel[0].ViewBusTime == true)
                        BusModel[0].ViewBusTime = false;
                    else
                        BusModel[0].ViewBusTime = true;
                }
                break;
            case "BusGridBusDateOfServiceView":
                {
                    if (BusModel[0].ViewBusDateOfService == true)
                        BusModel[0].ViewBusDateOfService = false;
                    else
                        BusModel[0].ViewBusDateOfService = true;
                }
                break;
            case "BusGridBusStartCityView":
                {
                    if (BusModel[0].ViewBusStartCity == true)
                        BusModel[0].ViewBusStartCity = false;
                    else
                        BusModel[0].ViewBusStartCity = true;
                }
                break;
            case "BusGridBusEndCityView":
                {
                    if (BusModel[0].ViewBusEndCity == true)
                        BusModel[0].ViewBusEndCity = false;
                    else
                        BusModel[0].ViewBusEndCity = true;
                }
                break;
            case "BusGridBusBusCountView":
                {
                    if (BusModel[0].ViewBusBusCount == true)
                        BusModel[0].ViewBusBusCount = false;
                    else
                        BusModel[0].ViewBusBusCount = true;
                }
                break;
            case "BusGridBusBusSizeView":
                {
                    if (BusModel[0].ViewBusBusSize == true)
                        BusModel[0].ViewBusBusSize = false;
                    else
                        BusModel[0].ViewBusBusSize = true;
                }
                break;
            case "BusGridBusPaxView":
                {
                    if (BusModel[0].ViewBusPax == true)
                        BusModel[0].ViewBusPax = false;
                    else
                        BusModel[0].ViewBusPax = true;
                }
                break;
            case "BusGridBusEstNumberofPersonView":
                {
                    if (BusModel[0].ViewBusEstNumberofPerson == true)
                        BusModel[0].ViewBusEstNumberofPerson = false;
                    else
                        BusModel[0].ViewBusEstNumberofPerson = true;
                }
                break;
            case "BusGridBusServiceCodeView":
                {
                    if (BusModel[0].ViewBusServiceCode == true)
                        BusModel[0].ViewBusServiceCode = false;
                    else
                        BusModel[0].ViewBusServiceCode = true;
                }
                break;
            case "BusGridBusServiceDetailView":
                {
                    if (BusModel[0].ViewBusServiceDetail == true)
                        BusModel[0].ViewBusServiceDetail = false;
                    else
                        BusModel[0].ViewBusServiceDetail = true;
                }
                break;
            case "BusGridBusEmployeeView":
                {
                    if (BusModel[0].ViewBusEmployee == true)
                        BusModel[0].ViewBusEmployee = false;
                    else
                        BusModel[0].ViewBusEmployee = true;
                }
                break;
            case "BusGridBusSupplierView":
                {
                    if (BusModel[0].ViewBusSupplier == true)
                        BusModel[0].ViewBusSupplier = false;
                    else
                        BusModel[0].ViewBusSupplier = true;
                }
                break;
            case "BusGridBusAirportView":
                {
                    if (BusModel[0].ViewBusAirport == true)
                        BusModel[0].ViewBusAirport = false;
                    else
                        BusModel[0].ViewBusAirport = true;
                }
                break;
            case "BusGridBusStatusView":
                {
                    if (BusModel[0].ViewBusStatus == true)
                        BusModel[0].ViewBusStatus = false;
                    else
                        BusModel[0].ViewBusStatus = true;
                }
                break;
            case "BusGridBusConfirmationView":
                {
                    if (BusModel[0].ViewBusConfirmation == true)
                        BusModel[0].ViewBusConfirmation = false;
                    else
                        BusModel[0].ViewBusConfirmation = true;
                }
                break;
            case "BusGridBusGuideView":
                {
                    if (BusModel[0].ViewBusGuide == true)
                        BusModel[0].ViewBusGuide = false;
                    else
                        BusModel[0].ViewBusGuide = true;
                }
                break;
            case "BusGridBusGuideSalaryView":
                {
                    if (BusModel[0].ViewBusGuideSalary == true)
                        BusModel[0].ViewBusGuideSalary = false;
                    else
                        BusModel[0].ViewBusGuideSalary = true;
                }
                break;
            case "BusGridBusGuideMiscView":
                {
                    if (BusModel[0].ViewBusGuideMisc == true)
                        BusModel[0].ViewBusGuideMisc = false;
                    else
                        BusModel[0].ViewBusGuideMisc = true;
                }
                break;
            case "BusGridBusGuideStepOnView":
                {
                    if (BusModel[0].ViewBusGuideStepOn == true)
                        BusModel[0].ViewBusGuideStepOn = false;
                    else
                        BusModel[0].ViewBusGuideStepOn = true;
                }
                break;
            case "BusGridBusGuideSalaryPaidView":
                {
                    if (BusModel[0].ViewBusGuideSalaryPaid == true)
                        BusModel[0].ViewBusGuideSalaryPaid = false;
                    else
                        BusModel[0].ViewBusGuideSalaryPaid = true;
                }
                break;
            case "BusGridBusCustomerView":
                {
                    if (BusModel[0].ViewBusCustomer == true)
                        BusModel[0].ViewBusCustomer = false;
                    else
                        BusModel[0].ViewBusCustomer = true;
                }
                break;
            case "BusGridBusGuideTotalCostView":
                {
                    if (BusModel[0].ViewBusGuideTotalCost == true)
                        BusModel[0].ViewBusGuideTotalCost = false;
                    else
                        BusModel[0].ViewBusGuideTotalCost = true;
                }
                break;
            case "BusGridBusBusTotalCostView":
                {
                    if (BusModel[0].ViewBusBusTotalCost == true)
                        BusModel[0].ViewBusBusTotalCost = false;
                    else
                        BusModel[0].ViewBusBusTotalCost = true;
                }
                break;
            case "BusGridBusPriceView":
                {
                    if (BusModel[0].ViewBusPrice == true)
                        BusModel[0].ViewBusPrice = false;
                    else
                        BusModel[0].ViewBusPrice = true;
                }
                break;
            case "BusGridBusBusCurrencyView":
                {
                    if (BusModel[0].ViewBusBusCurrency == true)
                        BusModel[0].ViewBusBusCurrency = false;
                    else
                        BusModel[0].ViewBusBusCurrency = true;
                }
                break;
            case "BusGridBusQuotaBusPriceView":
                {
                    if (BusModel[0].ViewBusQuotaBusPrice == true)
                        BusModel[0].ViewBusQuotaBusPrice = false;
                    else
                        BusModel[0].ViewBusQuotaBusPrice = true;
                }
                break;
            case "BusGridBusQuotaSupplierView":
                {
                    if (BusModel[0].ViewBusQuotaSupplier == true)
                        BusModel[0].ViewBusQuotaSupplier = false;
                    else
                        BusModel[0].ViewBusQuotaSupplier = true;
                }
                break;
            case "BusGridBusGuideCurrencyView":
                {
                    if (BusModel[0].ViewBusGuideCurrency == true)
                        BusModel[0].ViewBusGuideCurrency = false;
                    else
                        BusModel[0].ViewBusGuideCurrency = true;
                }
                break;
            case "BusGridBusQuotaGuideSalaryView":
                {
                    if (BusModel[0].ViewBusQuotaGuideSalary == true)
                        BusModel[0].ViewBusQuotaGuideSalary = false;
                    else
                        BusModel[0].ViewBusQuotaGuideSalary = true;
                }
                break;
            case "BusGridBusQuotaGuideMiscView":
                {
                    if (BusModel[0].ViewBusQuotaGuideMisc == true)
                        BusModel[0].ViewBusQuotaGuideMisc = false;
                    else
                        BusModel[0].ViewBusQuotaGuideMisc = true;
                }
                break;
            case "BusGridBusQuotaGuideStepOnView":
                {
                    if (BusModel[0].ViewBusQuotaGuideStepOn == true)
                        BusModel[0].ViewBusQuotaGuideStepOn = false;
                    else
                        BusModel[0].ViewBusQuotaGuideStepOn = true;
                }
                break;
            case "BusGridBusQuotaGuideView":
                {
                    if (BusModel[0].ViewBusQuotaGuide == true)
                        BusModel[0].ViewBusQuotaGuide = false;
                    else
                        BusModel[0].ViewBusQuotaGuide = true;
                }
                break;
            case "BusGridBusGuideSalaryInvoicePaidView":
                {
                    if (BusModel[0].ViewBusGuideSalaryInvoicePaid == true)
                        BusModel[0].ViewBusGuideSalaryInvoicePaid = false;
                    else
                        BusModel[0].ViewBusGuideSalaryInvoicePaid = true;
                }
                break;
            case "BusGridBusFirstPaymentView":
                {
                    if (BusModel[0].ViewBusFirstPayment == true)
                        BusModel[0].ViewBusFirstPayment = false;
                    else
                        BusModel[0].ViewBusFirstPayment = true;
                }
                break;
            case "BusGridBusFirstPaymentMethodView":
                {
                    if (BusModel[0].ViewBusSelectedFirstPaymentMethod == true)
                        BusModel[0].ViewBusSelectedFirstPaymentMethod = false;
                    else
                        BusModel[0].ViewBusSelectedFirstPaymentMethod = true;
                }
                break;
            case "BusGridBusDateFirstPaymentView":
                {
                    if (BusModel[0].ViewBusDateFirstPayment == true)
                        BusModel[0].ViewBusDateFirstPayment = false;
                    else
                        BusModel[0].ViewBusDateFirstPayment = true;
                }
                break;
            case "BusGridBusSecondPaymentView":
                {
                    if (BusModel[0].ViewBusSecondPayment == true)
                        BusModel[0].ViewBusSecondPayment = false;
                    else
                        BusModel[0].ViewBusSecondPayment = true;
                }
                break;
            case "BusGridBusSecondPaymentMethodView":
                {
                    if (BusModel[0].ViewBusSelectedSecondPaymentMethod == true)
                        BusModel[0].ViewBusSelectedSecondPaymentMethod = false;
                    else
                        BusModel[0].ViewBusSelectedSecondPaymentMethod = true;
                }
                break;
            case "BusGridBusDateSecondPaymentView":
                {
                    if (BusModel[0].ViewBusDateSecondPayment == true)
                        BusModel[0].ViewBusDateSecondPayment = false;
                    else
                        BusModel[0].ViewBusDateSecondPayment = true;
                }
                break;
            case "BusGridBusThirdPaymentView":
                {
                    if (BusModel[0].ViewBusThirdPayment == true)
                        BusModel[0].ViewBusThirdPayment = false;
                    else
                        BusModel[0].ViewBusThirdPayment = true;
                }
                break;
            case "BusGridBusThirdPaymentMethodView":
                {
                    if (BusModel[0].ViewBusSelectedThirdPaymentMethod == true)
                        BusModel[0].ViewBusSelectedThirdPaymentMethod = false;
                    else
                        BusModel[0].ViewBusSelectedThirdPaymentMethod = true;
                }
                break;
            case "BusGridBusDateThirdPaymentView":
                {
                    if (BusModel[0].ViewBusDateThirdPayment == true)
                        BusModel[0].ViewBusDateThirdPayment = false;
                    else
                        BusModel[0].ViewBusDateThirdPayment = true;
                }
                break;
            case "BusGridBusGuideFirstPaymentView":
                {
                    if (BusModel[0].ViewBusGuideFirstPayment == true)
                        BusModel[0].ViewBusGuideFirstPayment = false;
                    else
                        BusModel[0].ViewBusGuideFirstPayment = true;
                }
                break;
            case "BusGridBusGuideFirstPaymentMethodView":
                {
                    if (BusModel[0].ViewBusGuideSelectedFirstPaymentMethod == true)
                        BusModel[0].ViewBusGuideSelectedFirstPaymentMethod = false;
                    else
                        BusModel[0].ViewBusGuideSelectedFirstPaymentMethod = true;
                }
                break;
            case "BusGridBusGuideDateFirstPaymentView":
                {
                    if (BusModel[0].ViewBusGuideDateFirstPayment == true)
                        BusModel[0].ViewBusGuideDateFirstPayment = false;
                    else
                        BusModel[0].ViewBusGuideDateFirstPayment = true;
                }
                break;
            case "BusGridBusGuideSecondPaymentView":
                {
                    if (BusModel[0].ViewBusGuideSecondPayment == true)
                        BusModel[0].ViewBusGuideSecondPayment = false;
                    else
                        BusModel[0].ViewBusGuideSecondPayment = true;
                }
                break;
            case "BusGridBusGuideSecondPaymentMethodView":
                {
                    if (BusModel[0].ViewBusGuideSelectedSecondPaymentMethod == true)
                        BusModel[0].ViewBusGuideSelectedSecondPaymentMethod = false;
                    else
                        BusModel[0].ViewBusGuideSelectedSecondPaymentMethod = true;
                }
                break;
            case "BusGridBusGuideDateSecondPaymentView":
                {
                    if (BusModel[0].ViewBusGuideDateSecondPayment == true)
                        BusModel[0].ViewBusGuideDateSecondPayment = false;
                    else
                        BusModel[0].ViewBusGuideDateSecondPayment = true;
                }
                break;
            case "BusGridBusGuideThirdPaymentView":
                {
                    if (BusModel[0].ViewBusGuideThirdPayment == true)
                        BusModel[0].ViewBusGuideThirdPayment = false;
                    else
                        BusModel[0].ViewBusGuideThirdPayment = true;
                }
                break;
            case "BusGridBusGuideThirdPaymentMethodView":
                {
                    if (BusModel[0].ViewBusGuideSelectedThirdPaymentMethod == true)
                        BusModel[0].ViewBusGuideSelectedThirdPaymentMethod = false;
                    else
                        BusModel[0].ViewBusGuideSelectedThirdPaymentMethod = true;
                }
                break;
            case "BusGridBusGuideDateThirdPaymentView":
                {
                    if (BusModel[0].ViewBusGuideDateThirdPayment == true)
                        BusModel[0].ViewBusGuideDateThirdPayment = false;
                    else
                        BusModel[0].ViewBusGuideDateThirdPayment = true;
                }
                break;
            case "BusGridBusNotesView":
                {
                    if (BusModel[0].ViewBusNotes == true)
                        BusModel[0].ViewBusNotes = false;
                    else
                        BusModel[0].ViewBusNotes = true;
                }
                break;
            default:
                break;
        }
        LoadBusGrid(true);
    }
    function CheckOperBusDataChanges() {
        if (!$("#OperBusSaveBtn").hasClass("GridDataChanged"))
            $("#OperBusSaveBtn").addClass("GridDataChanged");
    }
    // Save Bus Grid Data
    function BusGridSave() {
        var Rows = $('#OperBusGrid').data('handsontable').getData();
        var SelectedBusFilterCustomerCode = [];
        $('#BusGridCustomerCodeMainDiv input[name=SelectedBusFilterCustomerCode]:checked').each(function () {
            SelectedBusFilterCustomerCode.push($(this).val());
        });
        var SelectedBusFilterGroupCode = [];
        $('#BusGridGroupCodeMainDiv input[name=SelectedBusFilterGroupCode]:checked').each(function () {
            SelectedBusFilterGroupCode.push($(this).val());
        });
        var SelectedBusFilterGroupName = [];
        $('#BusGridGroupNameMainDiv input[name=SelectedBusFilterGroupName]:checked').each(function () {
            SelectedBusFilterGroupName.push($(this).val());
        });
        var SelectedBusFilterVendorName = [];
        $('#BusGridVendorNameMainDiv input[name=SelectedBusFilterVendorName]:checked').each(function () {
            SelectedBusFilterVendorName.push($(this).val());
        });
        var SelectedBusFilterStartCity = [];
        $('#BusGridStartCityMainDiv input[name=SelectedBusFilterStartCity]:checked').each(function () {
            SelectedBusFilterStartCity.push($(this).val());
        });
        var SelectedBusFilterEndCity = [];
        $('#BusGridEndCityMainDiv input[name=SelectedBusFilterEndCity]:checked').each(function () {
            SelectedBusFilterEndCity.push($(this).val());
        });
        var SelectedBusFilterStatus = [];
        $('#BusGridStatusMainDiv input[name=SelectedBusFilterStatus]:checked').each(function () {
            SelectedBusFilterStatus.push($(this).val());
        });
        var OperationBusGridViewModel = {
            SaveRows: [],
            // show hide
            ViewBusIsInvoice: BusModel[0].ViewBusIsInvoice,
            ViewBusInvoicePrice: BusModel[0].ViewBusInvoicePrice,
            ViewBusGroupCode: BusModel[0].ViewBusGroupCode,
            ViewBusConfHtml: BusModel[0].ViewBusConfHtml,
            ViewBusGroupName: BusModel[0].ViewBusGroupName,
            ViewBusCustomer: BusModel[0].ViewBusCustomer,
            ViewBusPax: BusModel[0].ViewBusPax,
            ViewBusEstNumberofPerson: BusModel[0].ViewBusEstNumberofPerson,
            ViewBusCost: BusModel[0].ViewBusCost,
            ViewBusGuideTotalPaid: BusModel[0].ViewBusGuideTotalPaid,
            ViewBusBusTotalPaid: BusModel[0].ViewBusBusTotalPaid,
            ViewBusGuideDifference: BusModel[0].ViewBusGuideDifference,
            ViewBusGuideMiscDifference: BusModel[0].ViewBusGuideMiscDifference,
            ViewBusGuideStepOnDifference: BusModel[0].ViewBusGuideStepOnDifference,
            ViewBusBusDifference: BusModel[0].ViewBusBusDifference,
            ViewBusStart: BusModel[0].ViewBusStart,
            ViewBusTime: BusModel[0].ViewBusTime,
            ViewBusDateOfService: BusModel[0].ViewBusDateOfService,
            ViewBusStartCity: BusModel[0].ViewBusStartCity,
            ViewRoomCount: BusModel[0].ViewRoomCount,
            ViewBusEndCity: BusModel[0].ViewBusEndCity,
            ViewBusBusCount: BusModel[0].ViewBusBusCount,
            ViewBusBusSize: BusModel[0].ViewBusBusSize,
            ViewBusServiceCode: BusModel[0].ViewBusServiceCode,
            ViewBusServiceDetail: BusModel[0].ViewBusServiceDetail,
            ViewBusEmployee: BusModel[0].ViewBusEmployee,
            ViewBusSupplier: BusModel[0].ViewBusSupplier,
            ViewBusAirport: BusModel[0].ViewBusAirport,
            ViewBusStatus: BusModel[0].ViewBusStatus,
            ViewBusConfirmation: BusModel[0].ViewBusConfirmation,
            ViewBusOperations: BusModel[0].ViewBusOperations,
            ViewBusGuide: BusModel[0].ViewBusGuide,
            ViewBusGuideSalary: BusModel[0].ViewBusGuideSalary,
            ViewBusGuideMisc: BusModel[0].ViewBusGuideMisc,
            ViewBusGuideStepOn: BusModel[0].ViewBusGuideStepOn,
            ViewBusBusCurrency: BusModel[0].ViewBusBusCurrency,
            ViewBusQuotaBusPrice: BusModel[0].ViewBusQuotaBusPrice,
            ViewBusQuotaSupplier: BusModel[0].ViewBusQuotaSupplier,
            ViewBusGuideCurrency: BusModel[0].ViewBusGuideCurrency,
            ViewBusQuotaGuideSalary: BusModel[0].ViewBusQuotaGuideSalary,
            ViewBusQuotaGuideMisc: BusModel[0].ViewBusQuotaGuideMisc,
            ViewBusQuotaGuideStepOn: BusModel[0].ViewBusQuotaGuideStepOn,
            ViewBusQuotaGuide: BusModel[0].ViewBusQuotaGuide,
            ViewBusGuideSalaryPaid: BusModel[0].ViewBusGuideSalaryPaid,
            ViewBusGuideAdditionalCharges: BusModel[0].ViewBusGuideAdditionalCharges,
            ViewBusGuideSalaryInvoicePaid: BusModel[0].ViewBusGuideSalaryInvoicePaid,
            ViewBusGuideTotalCost: BusModel[0].ViewBusGuideTotalCost,
            ViewBusBusTotalCost: BusModel[0].ViewBusBusTotalCost,
            ViewBusPrice: BusModel[0].ViewBusPrice,
            ViewBusFirstPayment: BusModel[0].ViewBusFirstPayment,
            ViewBusSelectedFirstPaymentMethod: BusModel[0].ViewBusSelectedFirstPaymentMethod,
            ViewBusDateFirstPayment: BusModel[0].ViewBusDateFirstPayment,
            ViewBusSecondPayment: BusModel[0].ViewBusSecondPayment,
            ViewBusSelectedSecondPaymentMethod: BusModel[0].ViewBusSelectedSecondPaymentMethod,
            ViewBusDateSecondPayment: BusModel[0].ViewBusDateSecondPayment,
            ViewBusThirdPayment: BusModel[0].ViewBusThirdPayment,
            ViewBusSelectedThirdPaymentMethod: BusModel[0].ViewBusSelectedThirdPaymentMethod,
            ViewBusDateThirdPayment: BusModel[0].ViewBusDateThirdPayment,
            ViewBusGuideFirstPayment: BusModel[0].ViewBusGuideFirstPayment,
            ViewBusGuideSelectedFirstPaymentMethod: BusModel[0].ViewBusGuideSelectedFirstPaymentMethod,
            ViewBusGuideDateFirstPayment: BusModel[0].ViewBusGuideDateFirstPayment,
            ViewBusGuideSecondPayment: BusModel[0].ViewBusGuideSecondPayment,
            ViewBusGuideSelectedSecondPaymentMethod: BusModel[0].ViewBusGuideSelectedSecondPaymentMethod,
            ViewBusGuideDateSecondPayment: BusModel[0].ViewBusGuideDateSecondPayment,
            ViewBusGuideThirdPayment: BusModel[0].ViewBusGuideThirdPayment,
            ViewBusGuideSelectedThirdPaymentMethod: BusModel[0].ViewBusGuideSelectedThirdPaymentMethod,
            ViewBusGuideDateThirdPayment: BusModel[0].ViewBusGuideDateThirdPayment,
            ViewBusNotes: BusModel[0].ViewBusNotes,
            // search part
            BusSearchStartFromDate: $("#BusSearchStartFromDate").val(),
            BusSearchStartToDate: $("#BusSearchStartToDate").val(),
            BusSearchStartCity: $("#BusSearchStartCity").val(),
            BusSearchEndCity: $("#BusSearchEndCity").val(),
            BusSearchCustomer: $("#BusSearchCustomer").val(),
            BusSearchGroupName: $("#BusSearchGroupName").val(),
            BusSearchGroupCode: $("#BusSearchGroupCode").val(),
            BusSearchVendorName: $("#BusSearchVendorName").val(),
            BusSearchGuideName: $("#BusSearchGuideName").val(),
            BusSearchEmployee: $("#BusSearchEmployee").val(),
            BusSearchEmployeeID: $("#BusSearchEmployeeID").val(),
            // Filter part
            SelectedBusFilterCustomerCode: SelectedBusFilterCustomerCode.length > 0 ? SelectedBusFilterCustomerCode : [],
            SelectedBusFilterGroupName: SelectedBusFilterGroupName.length > 0 ? SelectedBusFilterGroupName : [],
            SelectedBusFilterGroupCode: SelectedBusFilterGroupCode.length > 0 ? SelectedBusFilterGroupCode : [],
            SelectedBusFilterStartCity: SelectedBusFilterStartCity.length > 0 ? SelectedBusFilterStartCity : [],
            SelectedBusFilterEndCity: SelectedBusFilterEndCity.length > 0 ? SelectedBusFilterEndCity : [],
            SelectedBusFilterVendorName: SelectedBusFilterVendorName.length > 0 ? SelectedBusFilterVendorName : [],
            SelectedBusFilterStatus: SelectedBusFilterStatus.length > 0 ? SelectedBusFilterStatus : [],
            // More and Scroll part
            BusPageNumber: $("#BusPageNumber").val(),
            IsBusCanPrev: $("#IsBusCanPrev").val(),
            IsBusCanNext: $("#IsBusCanNext").val(),
            BusLeftScrollPossition: parseFloat($("#OperBusGrid").scrollLeft()),
            BusTopScrollPossition: parseFloat($("#OperBusGrid").scrollTop()),
        };
        var RowsValidate = $('#OperBusGrid').find('.htInvalid');
        if (Rows.length > 1) {
            if (RowsValidate.length == 0) {
                var IsValidTime = true;
                var IsValidServiceDetail = true;
                var IsNotSaveRow = true;
                $(Rows).each(function (index, elem) {
                    if (index < Rows.length - 1) {
                        var BusStatus = BusGetIDFromList(BusModel[0].VendorStatus, elem.BusStatus);
                        if (BusStatus == 2 && (elem.BusTime == undefined || (elem.BusTime != undefined && elem.BusTime.length == 0))) {
                            IsValidTime = false;
                            return;
                        }
                        if (BusStatus == 2 && (elem.BusSelectedDetail == undefined || (elem.BusSelectedDetail != undefined && elem.BusSelectedDetail.length == 0))) {
                            IsValidServiceDetail = false;
                            return;
                        }
                        if (!(elem.BusTime == undefined || (elem.BusTime != undefined && elem.BusTime.length == 0)) || !(elem.BusNewTime == undefined || (elem.BusNewTime != undefined && elem.BusNewTime.length == 0))) {
                            var RowItm = {
                                GroupID: elem.BusGroupID,
                                VendorID: elem.BusVendorID,
                                NewVendorID: elem.BusNewVendorID,
                                GuideID: elem.BusGuideID,
                                NewGuideID: elem.BusNewGuideID,
                                Pax: elem.BusPax,
                                StartDate: (index < BusOldDate.length) ? BusOldDate[index] : null,
                                NewStartDate: elem.BusStart,
                                Time: elem.BusTime,
                                NewTime: elem.BusNewTime,
                                IsInvoice: elem.BusIsInvoice,
                                InvoicePrice: elem.BusInvoicePrice,
                                SelectedDetailID: BusGetIDFromListDetail(BusModel[0].Details, elem.BusSelectedDetail),
                                SelectedServiceID: BusGetIDFromListService(BusModel[0].Services, elem.BusSelectedService),
                                SelectedEmployeeID: BusGetIDFromList(BusModel[0].Employee, elem.BusSelectedEmployee),
                                BusSelectedVendorStatus: BusGetIDFromList(BusModel[0].VendorStatus, elem.BusStatus),
                                DateOfService: elem.BusDateOfService,
                                StartCity: elem.BusStartCity,
                                EndCity: elem.BusEndCity,
                                BusCount: elem.BusBusCount,
                                BusSize: elem.BusBusSize,
                                BusPrice: elem.BusPrice,
                                Airport: elem.BusAirport,
                                BusNotes: elem.BusNotes,
                                GuideSalary: elem.BusGuideSalary,
                                GuideMisc: elem.BusGuideMisc,
                                GuideStepOn: elem.BusGuideStepOn,
                                GuideSalaryPaid: elem.BusGuideSalaryPaid,
                                GuideAddCharge: elem.BusGuideAdditionalCharges,
                                GuidePaidAmt: elem.BusGuideSalaryInvoicePaid,
                                BusFirstPayment: elem.BusFirstPayment,
                                BusSelectedFirstPaymentMethod: elem.BusSelectedFirstPaymentMethod,
                                BusDateFirstPayment: elem.BusDateFirstPayment,
                                BusSecondPayment: elem.BusSecondPayment,
                                BusSelectedSecondPaymentMethod: elem.BusSelectedSecondPaymentMethod,
                                BusDateSecondPayment: elem.BusDateSecondPayment,
                                BusThirdPayment: elem.BusThirdPayment,
                                BusSelectedThirdPaymentMethod: elem.BusSelectedThirdPaymentMethod,
                                BusDateThirdPayment: elem.BusDateThirdPayment,
                                BusGuideFirstPayment: elem.BusGuideFirstPayment,
                                BusGuideSelectedFirstPaymentMethod: elem.BusGuideSelectedFirstPaymentMethod,
                                BusGuideDateFirstPayment: elem.BusGuideDateFirstPayment,
                                BusGuideSecondPayment: elem.BusGuideSecondPayment,
                                BusGuideSelectedSecondPaymentMethod: elem.BusGuideSelectedSecondPaymentMethod,
                                BusGuideDateSecondPayment: elem.BusGuideDateSecondPayment,
                                BusGuideThirdPayment: elem.BusGuideThirdPayment,
                                BusGuideSelectedThirdPaymentMethod: elem.BusGuideSelectedThirdPaymentMethod,
                                BusGuideDateThirdPayment: elem.BusGuideDateThirdPayment,
                                BusQuotaCurr: elem.BusQuotaBusCurr,

                            };
                            OperationBusGridViewModel.SaveRows.push(RowItm);
                            IsNotSaveRow = false;
                        }
                    }
                });
                if (IsNotSaveRow) {
                    jAlert("In grid all times null.", "Error!");
                    return;
                }
                if (IsValidTime == false) {
                    jAlert("If vendor status made time can't be empty.", "Error!");
                    return;
                }
                if (IsValidServiceDetail == false) {
                    jAlert("If vendor status made service detail can't be empty.", "Error!");
                    return;
                }
                var DTO = JSON.stringify(OperationBusGridViewModel);
                $.ajax({
                    url: urls["OperationBusGridSave"],
                    type: 'POST',
                    contentType: 'application/json; charset=utf-8',
                    data: DTO,
                    success: function (data) {
                        $("#tabBus").html(data);
                        debugger;
                        
                    },
                    error: function (xhr) {
                        //   alert('Error: ' + xhr.statusText);
                    },
                    complete: function () {
                        if ($("#BusLeftScrollPossition").val() != "") {
                            $("#OperBusGrid").scrollLeft(parseFloat($("#BusLeftScrollPossition").val()));
                        }
                        if ($("#BusTopScrollPossition").val() != "") {
                            $("#OperBusGrid").scrollTop(parseFloat($("#BusTopScrollPossition").val()));
                        }
                        //  $("#LoadingDiv").hide();
                        OperTechProgSearch();
                        UpdateGrpProfits();
                    }
                });
            }
            else {
                jAlert("You have invalid data", "Error!");
            }
        }
        else {
            jAlert("You have not any data for save", "Error!");
        }

    }
    function BusUpdateFormProp(LineNo, VendorID, Instance, row, Category) {
        if (Category != "Guide") {
            if (LineNo == 1) {
                Instance.getData()[row].BusFirstPayment = $("#AuthorizedAmount").val();
                Instance.getData()[row].BusDateFirstPayment = $("#Date").val();
                Instance.render();
            }
            if (LineNo == 2) {
                Instance.getData()[row].BusSecondPayment = $("#AuthorizedAmount").val();
                Instance.getData()[row].BusDateSecondPayment = $("#Date").val();
                Instance.render();
            }
            if (LineNo == 3) {
                Instance.getData()[row].BusThirdPayment = $("#AuthorizedAmount").val();
                Instance.getData()[row].BusDateThirdPayment = $("#Date").val();
                Instance.render();
            }
        }
        else {
            if (LineNo == 1) {
                Instance.getData()[row].BusGuideFirstPayment = $("#AuthorizedAmount").val();
                Instance.getData()[row].BusGuideDateFirstPayment = $("#Date").val();
                Instance.render();
            }
            if (LineNo == 2) {
                Instance.getData()[row].BusGuideSecondPayment = $("#AuthorizedAmount").val();
                Instance.getData()[row].BusGuideDateSecondPayment = $("#Date").val();
                Instance.render();
            }
            if (LineNo == 3) {
                Instance.getData()[row].BusGuideThirdPayment = $("#AuthorizedAmount").val();
                Instance.getData()[row].BusGuideDateThirdPayment = $("#Date").val();
                Instance.render();
            }
        }
    }
    function BusGetIDFromList(List, selItem) {
        var RetVal = 0;
        $(List).each(function (index, elem) {
            if (elem.Text == selItem)
                RetVal = parseInt(elem.Value);
        });
        return RetVal;
    }
    function BusGetIDFromListDetail(List, selItem) {
        var RetVal = 0;
        $(List).each(function (index, elem) {
            if (elem.DetailCode == selItem)
                RetVal = parseInt(elem.DetailID);
        });
        return RetVal;
    }
    function BusGetIDFromListService(List, selItem) {
        var RetVal = 0;
        $(List).each(function (index, elem) {
            if (elem.ServiceCode == selItem)
                RetVal = parseInt(elem.ServiceID);
        });
        return RetVal;
    }
    // toggle Search params
    function BusSearchToggle() {
        if ($("#SearchBusToggleDiv").hasClass("SearchHotelToggleDivMore")) {
            $("#SearchBusToggleDiv").removeClass("SearchHotelToggleDivMore");
            $("#SearchBusToggleDiv").addClass("SearchHotelToggleDivLess");
        }
        else {
            $("#SearchBusToggleDiv").addClass("SearchHotelToggleDivMore");
            $("#SearchBusToggleDiv").removeClass("SearchHotelToggleDivLess");
        }
        $("#OperSearchBus").toggle(200);
    };
    $(document).on("copy", "#BusGetSelected", function (e) {
        debugger
        BusGetSelectedClick();
        var table = $("#BusForEmail");
        e.clipboardData.clearData();
        e.clipboardData.setData("text/html", table.html());
        e.preventDefault();
        $("#BusForEmail").remove();
        $("#BusGetSelected").attr('disabled', true);

    });
    function RemoveBusFilter(element) {
        debugger
        var columnFilter = $(element).attr('id');
        switch (columnFilter) {
            case "BusRemoveCustomerFilter":
                {
                    $("#IsRemoveBusCustomerCodeFilter").val("True");
                }
                break;
            case "BusRemoveGroupCodeFilter":
                {
                    $("#IsRemoveBusGroupCodeFilter").val("True");
                }
                break;
            case "BusRemoveGroupNameFilter":
                {
                    $("#IsRemoveBusGroupNameFilter").val("True");
                }
                break;
            case "BusRemoveVendorNameFilter":
                {
                    $("#IsRemoveBusVendorNameFilter").val("True");
                }
                break;
            case "BusRemoveStartCityFilter":
                {
                    $("#IsRemoveBusStartCityFilter").val("True");
                }
                break;
            case "BusRemoveEndCityFilter":
                {
                    $("#IsRemoveBusEndCityFilter").val("True");
                }
                break;
            case "BusRemoveStatusFilter":
                {
                    $("#IsRemoveBusStatusFilter").val("True");
                }
                break;
            default:
                break;
        }
        $("#BusPageNumber").val(1);
        BusPageNum = 1;
        $("#IsBusFilter").val("True");
        isBusFilter = "True";
        $("#BusGridUpdate").click();
    }
</script>
<div class="OperationTabsTitleDiv">
    <span class="OperationTabsTitle">Bus</span>
</div>
<div id="OperationBusAmexVendorDetailsDiv" style="display:none;"></div>
@using (Ajax.BeginForm("SaveOperationBusGridData", "Operation", new AjaxOptions() { HttpMethod = "Post", OnComplete = "BusGridAjaxCompleted", UpdateTargetId = "tabBus", InsertionMode = InsertionMode.Replace }, new { enctype = "multipart/form-data", id = "OperBusGridForm" }))
{
    <div id="SearchBusToggleDiv" class="SearchHotelToggleDivMore" onclick="BusSearchToggle()"></div>
    <div id="OperSearchBus" style="display: none; height: 140px; width:1185px; background-color: rgba(128, 128, 128, 0.8); ">
        <div class="pull-right" style="margin-left:25px; margin-bottom:15px;">

            <div class="row form-row">
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchStartFromDate)</span>
                        @Html.TextBoxFor(model => model.BusSearchStartFromDate, new { @class = "form-control SearchDate table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchStartToDate)</span>
                        @Html.TextBoxFor(model => model.BusSearchStartToDate, new { @class = "form-control SearchDate table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchStartCity)</span>
                        @Html.TextBoxFor(model => model.BusSearchStartCity, new { @class = "form-control table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchEndCity)</span>
                        @Html.TextBoxFor(model => model.BusSearchEndCity, new { @class = "form-control table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
            </div>
            <div class="row form-row">
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchCustomer)</span>
                        @Html.TextBoxFor(model => model.BusSearchCustomer, new { @class = "TxtComplete form-control table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchGroupName)</span>
                        @Html.TextBoxFor(model => model.BusSearchGroupName, new { @class = "TxtComplete form-control table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchGroupCode)</span>
                        @Html.TextBoxFor(model => model.BusSearchGroupCode, new { @class = "TxtComplete form-control table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
            </div>
            <div class="row form-row">
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchVendorName)</span>
                        @Html.TextBoxFor(model => model.BusSearchVendorName, new { @class = "TxtComplete form-control table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchGuideName)</span>
                        @Html.TextBoxFor(model => model.BusSearchGuideName, new { @class = "form-control table_inputs_SmallPadding2 inpputgr" })
                    </div>
                </div>
                <div class=" col-lg-3">
                    <div class="input-group">
                        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BusSearchEmployee)</span>
                        @Html.TextBoxFor(model => model.BusSearchEmployee, new { @class = "TxtComplete form-control table_inputs_SmallPadding2 inpputgr Emp" })
                        @Html.HiddenFor(model => model.BusSearchEmployeeID)
                    </div>
                </div>
                <div class="pull-right col-lg-3">
                    <div class="pull-right input-group">
                        <input type="button" id="BusGroupSearchBtn" onclick="BusGroupSearchBtnClick()" class="btn14 pull-right" value="Search" style="margin-right:17px;">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="BusGridBusIsInvoiceDiv" style="@(@Model.ViewBusIsInvoice ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Inv</span><div id="BusGridBusIsInvoiceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusInvoicePriceDiv" style="@(@Model.ViewBusInvoicePrice ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Inv. Price</span><div id="BusGridBusInvoicePriceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGroupCodeDiv" style="@(@Model.ViewBusGroupCode ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Group Code</span><div id="BusGridBusGroupCodeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusConfHtmlDiv" style="@(@Model.ViewBusConfHtml ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Details</span><div id="BusGridBusConfHtmlView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGroupNameDiv" style="@(@Model.ViewBusGroupName? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Group Name</span><div id="BusGridBusGroupNameView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusCustomerDiv" style="@(@Model.ViewBusCustomer? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Customer</span><div id="BusGridBusCustomerView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusPaxDiv" style="@(@Model.ViewBusPax? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Pax</span><div id="BusGridBusPaxView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusEstNumberofPersonDiv" style="@(@Model.ViewBusEstNumberofPerson ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Est. Pax</span><div id="BusGridBusEstNumberofPersonView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusCostDiv" style="@(@Model.ViewBusCost ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Cost</span><div id="BusGridBusCostView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideAdditionalChargesDiv" style="@(@Model.ViewBusGuideAdditionalCharges ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Additional Charges</span><div id="BusGridBusGuideAdditionalChargesView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideTotalPaidDiv" style="@(@Model.ViewBusGuideTotalPaid ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Total Paid</span><div id="BusGridBusGuideTotalPaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusBusTotalPaidDiv" style="@(@Model.ViewBusBusTotalPaid ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Total Paid</span><div id="BusGridBusBusTotalPaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideDifferenceDiv" style="@(@Model.ViewBusGuideDifference ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Difference</span><div id="BusGridBusGuideDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideMiscDifferenceDiv" style="@(@Model.ViewBusGuideMiscDifference ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Misc Diff</span><div id="BusGridBusGuideMiscDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideStepOnDifferenceDiv" style="@(@Model.ViewBusGuideStepOnDifference ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide StepOn Diff</span><div id="BusGridBusGuideStepOnDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusBusDifferenceDiv" style="@(@Model.ViewBusBusDifference ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Difference</span><div id="BusGridBusBusDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusStartDiv" style="@(@Model.ViewBusStart ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Start</span><div id="BusGridBusStartView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusTimeDiv" style="@(@Model.ViewBusTime ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Time</span><div id="BusGridBusTimeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusDateOfServiceDiv" style="@(@Model.ViewBusDateOfService ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Service Date</span><div id="BusGridBusDateOfServiceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusStartCityDiv" style="@(@Model.ViewBusStartCity ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Start City</span><div id="BusGridBusStartCityView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusEndCityDiv" style="@(@Model.ViewBusEndCity ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>End City</span><div id="BusGridBusEndCityView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusBusCountDiv" style="@(@Model.ViewBusBusCount ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Count</span><div id="BusGridBusBusCountView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusBusSizeDiv" style="@(@Model.ViewBusBusSize ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Size</span><div id="BusGridBusBusSizeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusServiceCodeDiv" style="@(@Model.ViewBusServiceCode ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Service Code</span><div id="BusGridBusServiceCodeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusServiceDetailDiv" style="@(@Model.ViewBusServiceDetail ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Service Detail</span><div id="BusGridBusServiceDetailView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusServiceDiv" style="@(@Model.ViewBusServiceDetail ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Service</span><div id="BusGridBusServiceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusEmployeeDiv" style="@(@Model.ViewBusEmployee ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Employee</span><div id="BusGridBusEmployeeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusSupplierDiv" style="@(@Model.ViewBusSupplier ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Supplier</span><div id="BusGridBusSupplierView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusAirportDiv" style="@(@Model.ViewBusAirport ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Airport</span><div id="BusGridBusAirportView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusStatusDiv" style="@(@Model.ViewBusStatus ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Status</span><div id="BusGridBusStatusView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusConfirmationDiv" style="@(@Model.ViewBusConfirmation ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Confirmation</span><div id="BusGridBusConfirmationView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideDiv" style="@(@Model.ViewBusGuide ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide</span><div id="BusGridBusGuideView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideSalaryDiv" style="@(@Model.ViewBusGuideSalary ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Salary</span><div id="BusGridBusGuideSalaryView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideMiscDiv" style="@(@Model.ViewBusGuideMisc ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Misc</span><div id="BusGridBusGuideMiscView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideStepOnDiv" style="@(@Model.ViewBusGuideStepOn ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide StepOn</span><div id="BusGridBusGuideStepOnView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideSalaryPaidDiv" style="@(@Model.ViewBusGuideSalaryPaid ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Salary Paid</span><div id="BusGridBusGuideSalaryPaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideTotalCostDiv" style="@(@Model.ViewBusGuideTotalCost ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Total Cost</span><div id="BusGridBusGuideTotalCostView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusBusTotalCostDiv" style="@(@Model.ViewBusBusTotalCost ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Total Cost</span><div id="BusGridBusBusTotalCostView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusPriceDiv" style="@(@Model.ViewBusPrice ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Price</span><div id="BusGridBusPriceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusBusCurrencyDiv" style="@(@Model.ViewBusBusCurrency ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Currency</span><div id="BusGridBusBusCurrencyView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusQuotaBusPriceDiv" style="@(@Model.ViewBusQuotaBusPrice ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Quota Price</span><div id="BusGridBusQuotaBusPriceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusQuotaSupplierDiv" style="@(@Model.ViewBusQuotaSupplier ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Quota Supplier</span><div id="BusGridBusQuotaSupplierView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideCurrencyDiv" style="@(@Model.ViewBusGuideCurrency ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Currency</span><div id="BusGridBusGuideCurrencyView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusQuotaGuideSalaryDiv" style="@(@Model.ViewBusQuotaGuideSalary ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Quota Guide Salary</span><div id="BusGridBusQuotaGuideSalaryView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusQuotaGuideMiscDiv" style="@(@Model.ViewBusQuotaGuideMisc ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Quota Guide Misc</span><div id="BusGridBusQuotaGuideMiscView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusQuotaGuideStepOnDiv" style="@(@Model.ViewBusQuotaGuideStepOn ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Quota Guide StepOn</span><div id="BusGridBusQuotaGuideStepOnView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusQuotaGuideDiv" style="@(@Model.ViewBusQuotaGuide ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Quota Guide</span><div id="BusGridBusQuotaGuideView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideSalaryInvoicePaidDiv" style="@(@Model.ViewBusGuideSalaryInvoicePaid ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Paid Amt</span><div id="BusGridBusGuideSalaryInvoicePaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusFirstPaymentDiv" style="@(@Model.ViewBusFirstPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus 1st Payment</span><div id="BusGridBusFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusFirstPaymentMethodDiv" style="@(@Model.ViewBusSelectedFirstPaymentMethod ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus 1st Payment Method</span><div id="BusGridBusFirstPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusDateFirstPaymentDiv" style="@(@Model.ViewBusDateFirstPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Date of 1st Payment</span><div id="BusGridBusDateFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusSecondPaymentDiv" style="@(@Model.ViewBusSecondPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus 2nd Payment</span><div id="BusGridBusSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusSecondPaymentMethodDiv" style="@(@Model.ViewBusSelectedSecondPaymentMethod ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus 2nd Payment Method</span><div id="BusGridBusSecondPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusDateSecondPaymentDiv" style="@(@Model.ViewBusDateSecondPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Date of 2nd Payment</span><div id="BusGridBusDateSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusThirdPaymentDiv" style="@(@Model.ViewBusThirdPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus 3rd Payment</span><div id="BusGridBusThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusThirdPaymentMethodDiv" style="@(@Model.ViewBusSelectedThirdPaymentMethod ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus 3rd Payment Method</span><div id="BusGridBusThirdPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusDateThirdPaymentDiv" style="@(@Model.ViewBusDateThirdPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Bus Date of 3rd Payment</span><div id="BusGridBusDateThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideFirstPaymentDiv" style="@(@Model.ViewBusGuideFirstPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide 1st Payment</span><div id="BusGridBusGuideFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideFirstPaymentMethodDiv" style="@(@Model.ViewBusGuideSelectedFirstPaymentMethod ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide 1st Payment Method</span><div id="BusGridBusGuideFirstPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideDateFirstPaymentDiv" style="@(@Model.ViewBusGuideDateFirstPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Date of 1st Payment</span><div id="BusGridBusGuideDateFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideSecondPaymentDiv" style="@(@Model.ViewBusGuideSecondPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide 2nd Payment</span><div id="BusGridBusGuideSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideSecondPaymentMethodDiv" style="@(@Model.ViewBusGuideSelectedSecondPaymentMethod ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide 2nd Payment Method</span><div id="BusGridBusGuideSecondPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideDateSecondPaymentDiv" style="@(@Model.ViewBusGuideDateSecondPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Date of 2nd Payment</span><div id="BusGridBusGuideDateSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideThirdPaymentDiv" style="@(@Model.ViewBusGuideThirdPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide 3rd Payment</span><div id="BusGridBusGuideThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideThirdPaymentMethodDiv" style="@(@Model.ViewBusGuideSelectedThirdPaymentMethod ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide 3rd Payment Method</span><div id="BusGridBusGuideThirdPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusGuideDateThirdPaymentDiv" style="@(@Model.ViewBusGuideDateThirdPayment ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Guide Date of 3rd Payment</span><div id="BusGridBusGuideDateThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusGridBusNotesDiv" style="@(@Model.ViewBusNotes ? "display:none" : "")">
        <div class="BusGridViewBtnDiv">
            <span>Notes</span><div id="BusGridBusNotesView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
        </div>
    </div>
    <div id="BusRemoveFiltersDiv" class="BusRemoveFiltersDiv" style="display:none">
        <span class="BusRemoveFiltersSpan">Filters :</span>
        @if (Model.BusFilterSelGroupCode != null)
        {
            if (Model.BusFilterSelGroupCode.Count > 0)
            {
                <div class="BusGridViewBtnDiv"><span>Group Code</span><div id="BusRemoveGroupCodeFilter" class="BusGridViewBtn" onclick="RemoveBusFilter(this)"></div></div>
                Model.IsRemoveBusFilterDivShow = true;
            }
        }
        @if (Model.BusFilterSelGroupName != null)
        {
            if (Model.BusFilterSelGroupName.Count > 0)
            {
                <div class="BusGridViewBtnDiv"><span>Group Name</span><div id="BusRemoveGroupNameFilter" class="BusGridViewBtn" onclick="RemoveBusFilter(this)"></div></div>
                Model.IsRemoveBusFilterDivShow = true;
            }
        }
        @if (Model.BusFilterSelCustomerCode != null)
        {
            if (Model.BusFilterSelCustomerCode.Count > 0)
            {
                <div class="BusGridViewBtnDiv"><span>Customer</span><div id="BusRemoveCustomerFilter" class="BusGridViewBtn" onclick="RemoveBusFilter(this)"></div></div>
                Model.IsRemoveBusFilterDivShow = true;
            }
        }
        @if (Model.BusFilterSelStatus != null)
        {
            if (Model.BusFilterSelStatus.Count > 0)
            {
                <div class="BusGridViewBtnDiv"><span>Status</span><div id="BusRemoveStatusFilter" class="BusGridViewBtn" onclick="RemoveBusFilter(this)"></div></div>
                Model.IsRemoveBusFilterDivShow = true;
            }
        }
        @if (Model.BusFilterSelVendorName != null)
        {
            if (Model.BusFilterSelVendorName.Count > 0)
            {
                <div class="BusGridViewBtnDiv"><span>Supplier</span><div id="BusRemoveVendorNameFilter" class="BusGridViewBtn" onclick="RemoveBusFilter(this)"></div></div>
                Model.IsRemoveBusFilterDivShow = true;
            }
        }
        @if (Model.BusFilterSelStartCity != null)
        {
            if (Model.BusFilterSelStartCity.Count > 0)
            {
                <div class="BusGridViewBtnDiv"><span>Start City</span><div id="BusRemoveStartCityFilter" class="BusGridViewBtn" onclick="RemoveBusFilter(this)"></div></div>
                Model.IsRemoveBusFilterDivShow = true;
            }
        }
        @if (Model.BusFilterSelEndCity != null)
        {
            if (Model.BusFilterSelEndCity.Count > 0)
            {
                <div class="BusGridViewBtnDiv"><span>End City</span><div id="BusRemoveEndCityFilter" class="BusGridViewBtn" onclick="RemoveBusFilter(this)"></div></div>
                Model.IsRemoveBusFilterDivShow = true;
            }
        }
    </div>
    <div id="OperBusGridFilters" style="width:1200px; float:left; padding-top:12px; padding-right:5px; padding-bottom:8px;">
        <div id="BusGridGroupCodeMainDiv" class="BusGridFilterDiv">
            <div class="BusGridFilterDivClose"></div>
            @Html.CheckBoxListFor(model => model.SelectedBusFilterGroupCode,
                                      model => model.BusFilterGroupCode,
                                      grp => grp.Id,
                                      grp => grp.Name,
                                      model => model.BusFilterSelGroupCode,
                                      MvcCheckBoxList.Model.Position.Vertical)
        </div>
        <div id="BusGridGroupNameMainDiv" class="BusGridFilterDiv">
            <div class="BusGridFilterDivClose"></div>
            @Html.CheckBoxListFor(model => model.SelectedBusFilterGroupName,
                                      model => model.BusFilterGroupName,
                                      grp => grp.Id,
                                      grp => grp.Name,
                                      model => model.BusFilterSelGroupName,
                                      MvcCheckBoxList.Model.Position.Vertical)
        </div>
        <div id="BusGridCustomerCodeMainDiv" class="BusGridFilterDiv">
            <div class="BusGridFilterDivClose"></div>
            @Html.CheckBoxListFor(model => model.SelectedBusFilterCustomerCode,
                                      model => model.BusFilterCustomerCode,
                                      grp => grp.Id,
                                      grp => grp.Name,
                                      model => model.BusFilterSelCustomerCode,
                                      MvcCheckBoxList.Model.Position.Vertical)
        </div>
        <div id="BusGridStatusMainDiv" class="AttractionsGridFilterDiv">
            <div class="BusGridFilterDivClose"></div>
            @Html.CheckBoxListFor(model => model.SelectedBusFilterStatus,
                                      model => model.BusFilterStatus,
                                      grp => grp.Id,
                                      grp => grp.Name,
                                      model => model.BusFilterSelStatus,
                                      MvcCheckBoxList.Model.Position.Vertical)
        </div>
        <div id="BusGridVendorNameMainDiv" class="BusGridFilterDiv">
            <div class="BusGridFilterDivClose"></div>
            @Html.CheckBoxListFor(model => model.SelectedBusFilterVendorName,
                                      model => model.BusFilterVendorName,
                                      grp => grp.Id,
                                      grp => grp.Name,
                                      model => model.BusFilterSelVendorName,
                                      MvcCheckBoxList.Model.Position.Vertical)
        </div>
        <div id="BusGridStartCityMainDiv" class="BusGridFilterDiv">
            <div class="BusGridFilterDivClose"></div>
            @Html.CheckBoxListFor(model => model.SelectedBusFilterStartCity,
                                      model => model.BusFilterStartCity,
                                      grp => grp.Id,
                                      grp => grp.Name,
                                      model => model.BusFilterSelStartCity,
                                      MvcCheckBoxList.Model.Position.Vertical)
        </div>
        <div id="BusGridEndCityMainDiv" class="BusGridFilterDiv">
            <div class="BusGridFilterDivClose"></div>
            @Html.CheckBoxListFor(model => model.SelectedBusFilterEndCity,
                                      model => model.BusFilterEndCity,
                                      grp => grp.Id,
                                      grp => grp.Name,
                                      model => model.BusFilterSelEndCity,
                                      MvcCheckBoxList.Model.Position.Vertical)
        </div>
    </div>
    <div style="display:none;">
        <div id="BusIsInvoiceDiv">
            <div class="OperationInvoice">
                <span>Inv</span>
                @Html.HiddenFor(model => model.ViewBusIsInvoice)
                <div id="BusGridBusIsInvoiceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusInvoicePriceDiv">
            <div class="OperationInvoice">
                <span>Inv. Price</span>
                @Html.HiddenFor(model => model.ViewBusInvoicePrice)
                <div id="BusGridBusInvoicePriceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGroupCodeDiv">
            <div class="OperationHotelGroupInfo">
                <span>Group Code</span>
                @Html.HiddenFor(model => model.ViewBusGroupCode)
                <div id="BusGridBusGroupCodeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
                @if (@Model.OperationBusGroupCodeFilter)
                {
                    <div class="BusGridFilterBtn" id="BusGridGroupCode"></div>
                }
            </div>
        </div>
        <div id="BusConfHtmlDiv">
            <div class="OperationHotelVendorInfo">
                <span>Details</span>
                @Html.HiddenFor(model => model.ViewBusConfHtml)
                <div id="BusGridBusConfHtmlView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGroupNameDiv">
            <div class="OperationHotelGroupInfo">
                <span>Group Name</span>
                @Html.HiddenFor(model => model.ViewBusGroupName)
                <div id="BusGridBusGroupNameView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
                @if (@Model.OperationBusGroupNameFilter)
                {
                    <div class="BusGridFilterBtn" id="BusGridGroupName"></div>
                }
            </div>
        </div>
        <div id="BusCustomerDiv">
            <div class="OperationHotelGroupInfo">
                <span>Customer</span>
                @Html.HiddenFor(model => model.ViewBusCustomer)
                <div id="BusGridBusCustomerView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
                @if (@Model.OperationBusCustomerFilter)
                {
                    <div class="BusGridFilterBtn" id="BusGridCustomerCode"></div>
                }
            </div>
        </div>
        <div id="BusEmployeeDiv">
            <div class="OperationHotelGroupInfo">
                <span>Employee</span>
                @Html.HiddenFor(model => model.ViewBusEmployee)
                <div id="BusGridBusEmployeeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusPaxDiv">
            <div class="OperationHotelGroupInfo">
                <span>Pax</span>
                @Html.HiddenFor(model => model.ViewBusPax)
                <div id="BusGridBusPaxView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusEstNumberofPersonDiv">
            <div class="OperationHotelGroupInfo">
                <span>Est. Pax</span>
                @Html.HiddenFor(model => model.ViewBusEstNumberofPerson)
                <div id="BusGridBusEstNumberofPersonView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusCostDiv">
            <div class="OperationHandsontable">
                <span>Cost</span>
                @Html.HiddenFor(model => model.ViewBusCost)
                <div id="BusGridBusCostView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideTotalPaidDiv">
            <div class="OperationHotelTotals">
                <span>Guide Total Paid</span>
                @Html.HiddenFor(model => model.ViewBusGuideTotalPaid)
                <div id="BusGridBusGuideTotalPaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusBusTotalPaidDiv">
            <div class="OperationHotelTotals">
                <span>Bus Total Paid</span>
                @Html.HiddenFor(model => model.ViewBusBusTotalPaid)
                <div id="BusGridBusBusTotalPaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideDifferenceDiv">
            <div class="OperationHotelTotals">
                <span>Guide Difference</span>
                @Html.HiddenFor(model => model.ViewBusGuideDifference)
                <div id="BusGridBusGuideDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideMiscDifferenceDiv">
            <div class="OperationHotelTotals">
                <span>Guide Misc Diff</span>
                @Html.HiddenFor(model => model.ViewBusGuideMiscDifference)
                <div id="BusGridBusGuideMiscDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideStepOnDifferenceDiv">
            <div class="OperationHotelTotals">
                <span>Guide StepOn Diff</span>
                @Html.HiddenFor(model => model.ViewBusGuideStepOnDifference)
                <div id="BusGridBusGuideStepOnDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusBusDifferenceDiv">
            <div class="OperationHotelTotals">
                <span>Bus Difference</span>
                @Html.HiddenFor(model => model.ViewBusBusDifference)
                <div id="BusGridBusBusDifferenceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusStartDiv">
            <div class="OperationHotelGroupInfo">
                <span>Start</span>
                @Html.HiddenFor(model => model.ViewBusStart)
                <div id="BusGridBusStartView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusTimeDiv">
            <div class="OperationHotelGroupInfo">
                <span>Time</span>
                @Html.HiddenFor(model => model.ViewBusTime)
                <div id="BusGridBusTimeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusDateOfServiceDiv">
            <div class="OperationHandsontable">
                <span>Service Date</span>
                @Html.HiddenFor(model => model.ViewBusDateOfService)
                <div id="BusGridBusDateOfServiceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusStartCityDiv">
            <div class="OperationHotelVendorInfo">
                <span>Start City</span>
                @Html.HiddenFor(model => model.ViewBusStartCity)
                <div id="BusGridBusStartCityView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
                @if (@Model.OperationBusStartCityFilter)
                {
                    <div class="BusGridFilterBtn" id="BusGridStartCity"></div>
                }
            </div>
        </div>
        <div id="BusEndCityDiv">
            <div class="OperationHotelVendorInfo">
                <span>End City</span>
                @Html.HiddenFor(model => model.ViewBusEndCity)
                <div id="BusGridBusEndCityView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
                @if (@Model.OperationBusEndCityFilter)
                {
                    <div class="BusGridFilterBtn" id="BusGridEndCity"></div>
                }
            </div>
        </div>
        <div id="BusBusCountDiv">
            <div class="OperationHotelVendorInfo">
                <span>Bus Count</span>
                @Html.HiddenFor(model => model.ViewBusBusCount)
                <div id="BusGridBusBusCountView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusBusSizeDiv">
            <div class="OperationHotelVendorInfo">
                <span>Bus Size</span>
                @Html.HiddenFor(model => model.ViewBusBusSize)
                <div id="BusGridBusBusSizeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusServiceCodeDiv">
            <div class="OperationHandsontable">
                <span>Service Code</span>
                @Html.HiddenFor(model => model.ViewBusServiceCode)
                <div id="BusGridBusServiceCodeView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusServiceDetailDiv">
            <div class="OperationHandsontable">
                <span>Service Detail</span>
                @Html.HiddenFor(model => model.ViewBusServiceDetail)
                <div id="BusGridBusServiceDetailView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusServiceDiv">
            <div class="OperationHandsontable">
                <span>Service</span>
                @Html.HiddenFor(model => model.ViewBusServiceDetail)
                <div id="BusGridBusServiceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusSupplierDiv">
            <div class="OperationHotelVendorInfo">
                <span>Supplier</span>
                @Html.HiddenFor(model => model.ViewBusSupplier)
                <div id="BusGridBusSupplierView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
                @if (@Model.OperationBusSupplierFilter)
                {
                    <div class="BusGridFilterBtn" id="BusGridVendorName"></div>
                }
            </div>
        </div>
        <div id="BusAirportDiv">
            <div class="OperationHotelVendorInfo">
                <span>Airport</span>
                @Html.HiddenFor(model => model.ViewBusAirport)
                <div id="BusGridBusAirportView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGroupContractHtmlDiv">
            <div class="OperationHotelVendorInfo">
                <span>View Vendor Contract</span>
            </div>
        </div>
        <div id="BusStatusDiv">
            <div class="OperationHotelVendorInfo">
                <span>Status</span>
                @Html.HiddenFor(model => model.ViewBusStatus)
                <div id="BusGridBusStatusView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
                @if (@Model.OperationBusStatusFilter)
                {
                    <div class="BusGridFilterBtn" id="BusGridStatus"></div>
                }
            </div>
        </div>
        <div id="BusConfirmationDiv">
            <div class="OperationHandsontable">
                <span>Confirmation</span>
                @Html.HiddenFor(model => model.ViewBusConfirmation)
                <div id="BusGridBusConfirmationView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusOperationsDiv">
            <div class="OperationHandsontable">
                <span>Operations</span>
                @Html.HiddenFor(model => model.ViewBusOperations)
                <div id="BusGridBusOperationsView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideDiv">
            <div class="OperationGuideInfo">
                <span>Guide</span>
                @Html.HiddenFor(model => model.ViewBusGuide)
                <div id="BusGridBusGuideView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideSalaryDiv">
            <div class="OperationGuideInfo">
                <span>Guide Salary</span>
                @Html.HiddenFor(model => model.ViewBusGuideSalary)
                <div id="BusGridBusGuideSalaryView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideMiscDiv">
            <div class="OperationGuideInfo">
                <span>Guide Misc</span>
                @Html.HiddenFor(model => model.ViewBusGuideMisc)
                <div id="BusGridBusGuideMiscView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideStepOnDiv">
            <div class="OperationGuideInfo">
                <span>Guide StepOn</span>
                @Html.HiddenFor(model => model.ViewBusGuideStepOn)
                <div id="BusGridBusGuideStepOnView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideSalaryPaidDiv">
            <div class="OperationGuideInfo">
                <span>Guide Salary Paid</span>
                @Html.HiddenFor(model => model.ViewBusGuideSalaryPaid)
                <div id="BusGridBusGuideSalaryPaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideAdditionalChargesDiv">
            <div class="OperationGuideInfo">
                <span>Guide Additional Charges</span>
                @Html.HiddenFor(model => model.ViewBusGuideAdditionalCharges)
                <div id="BusGridBusGuideAdditionalChargerView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideSalaryInvoicePaidDiv">
            <div class="OperationGuideInfo">
                <span>Guide Paid Amt</span>
                @Html.HiddenFor(model => model.ViewBusGuideSalaryInvoicePaid)
                <div id="BusGridBusGuideSalaryInvoicePaidView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideTotalCostDiv">
            <div class="OperationHotelTotals">
                <span>Guide Total Cost</span>
                @Html.HiddenFor(model => model.ViewBusGuideTotalCost)
                <div id="BusGridBusGuideTotalCostView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusBusTotalCostDiv">
            <div class="OperationHotelTotals">
                <span>Bus Total Cost</span>
                @Html.HiddenFor(model => model.ViewBusBusTotalCost)
                <div id="BusGridBusBusTotalCostView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusPriceDiv">
            <div class="OperationHotelVendorInfo">
                <span>Bus Price</span>
                @Html.HiddenFor(model => model.ViewBusPrice)
                <div id="BusGridBusPriceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusBusCurrencyDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Bus Currency</span>
                @Html.HiddenFor(model => model.ViewBusBusCurrency)
                <div id="BusGridBusBusCurrencyView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusQuotaBusPriceDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Bus Quota Price</span>
                @Html.HiddenFor(model => model.ViewBusQuotaBusPrice)
                <div id="BusGridBusQuotaBusPriceView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusQuotaSupplierDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Quota Supplier</span>
                @Html.HiddenFor(model => model.ViewBusQuotaSupplier)
                <div id="BusGridBusQuotaSupplierView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideCurrencyDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Guide Currency</span>
                @Html.HiddenFor(model => model.ViewBusGuideCurrency)
                <div id="BusGridBusGuideCurrencyView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusQuotaGuideSalaryDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Quota Guide Salary</span>
                @Html.HiddenFor(model => model.ViewBusQuotaGuideSalary)
                <div id="BusGridBusQuotaGuideSalaryView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusQuotaGuideMiscDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Quota Guide Misc</span>
                @Html.HiddenFor(model => model.ViewBusQuotaGuideMisc)
                <div id="BusGridBusQuotaGuideMiscView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusQuotaGuideStepOnDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Quota Guide StepOn</span>
                @Html.HiddenFor(model => model.ViewBusQuotaGuideStepOn)
                <div id="BusGridBusQuotaGuideStepOnView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusQuotaGuideDiv">
            <div class="OperationHotelQuotaInfo">
                <span>Quota Guide</span>
                @Html.HiddenFor(model => model.ViewBusQuotaGuide)
                <div id="BusGridBusQuotaGuideView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusFirstPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Bus 1st Payment</span>
                @Html.HiddenFor(model => model.ViewBusFirstPayment)
                <div id="BusGridBusFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusFirstPaymentMethodDiv">
            <div class="OperationHotelPayments">
                <span>Bus 1st Payment Method</span>
                @Html.HiddenFor(model => model.ViewBusSelectedFirstPaymentMethod)
                <div id="BusGridBusFirstPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusPayMeth1FormHtmlDiv">
            <div class="OperationHotelPayments">
                <span>Bus Pay 1 Details</span>
            </div>
        </div>
        <div id="BusDateFirstPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Bus Date of 1st Payment</span>
                @Html.HiddenFor(model => model.ViewBusDateFirstPayment)
                <div id="BusGridBusDateFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusSecondPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Bus 2nd Payment</span>
                @Html.HiddenFor(model => model.ViewBusSecondPayment)
                <div id="BusGridBusSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusSecondPaymentMethodDiv">
            <div class="OperationHotelPayments">
                <span>Bus 2nd Payment Method</span>
                @Html.HiddenFor(model => model.ViewBusSelectedSecondPaymentMethod)
                <div id="BusGridBusSecondPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusPayMeth2FormHtmlDiv">
            <div class="OperationHotelPayments">
                <span>Bus Pay 2 Details</span>
            </div>
        </div>
        <div id="BusDateSecondPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Bus Date of 2nd Payment</span>
                @Html.HiddenFor(model => model.ViewBusDateSecondPayment)
                <div id="BusGridBusDateSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusThirdPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Bus 3rd Payment</span>
                @Html.HiddenFor(model => model.ViewBusThirdPayment)
                <div id="BusGridBusThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusThirdPaymentMethodDiv">
            <div class="OperationHotelPayments">
                <span>Bus 3rd Payment Method</span>
                @Html.HiddenFor(model => model.ViewBusSelectedThirdPaymentMethod)
                <div id="BusGridBusThirdPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusPayMeth3FormHtmlDiv">
            <div class="OperationHotelPayments">
                <span>Bus Pay 3 Details</span>
            </div>
        </div>
        <div id="BusDateThirdPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Bus Date of 3rd Payment</span>
                @Html.HiddenFor(model => model.ViewBusDateThirdPayment)
                <div id="BusGridBusDateThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideFirstPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Guide 1st Payment</span>
                @Html.HiddenFor(model => model.ViewBusGuideFirstPayment)
                <div id="BusGridBusGuideFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideFirstPaymentMethodDiv">
            <div class="OperationHotelPayments">
                <span>Guide 1st Payment Method</span>
                @Html.HiddenFor(model => model.ViewBusGuideSelectedFirstPaymentMethod)
                <div id="BusGridBusGuideFirstPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuidePayMeth1FormHtmlDiv">
            <div class="OperationHotelPayments">
                <span>Guide Pay 1 Details</span>
            </div>
        </div>
        <div id="BusGuideDateFirstPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Guide Date of 1st Payment</span>
                @Html.HiddenFor(model => model.ViewBusGuideDateFirstPayment)
                <div id="BusGridBusGuideDateFirstPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideSecondPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Guide 2nd Payment</span>
                @Html.HiddenFor(model => model.ViewBusGuideSecondPayment)
                <div id="BusGridBusGuideSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideSecondPaymentMethodDiv">
            <div class="OperationHotelPayments">
                <span>Guide 2nd Payment Method</span>
                @Html.HiddenFor(model => model.ViewBusGuideSelectedSecondPaymentMethod)
                <div id="BusGridBusGuideSecondPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuidePayMeth2FormHtmlDiv">
            <div class="OperationHotelPayments">
                <span>Guide Pay 2 Details</span>
            </div>
        </div>
        <div id="BusGuideDateSecondPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Guide Date of 2nd Payment</span>
                @Html.HiddenFor(model => model.ViewBusGuideDateSecondPayment)
                <div id="BusGridBusGuideDateSecondPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideThirdPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Guide 3rd Payment</span>
                @Html.HiddenFor(model => model.ViewBusGuideThirdPayment)
                <div id="BusGridBusGuideThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuideThirdPaymentMethodDiv">
            <div class="OperationHotelPayments">
                <span>Guide 3rd Payment Method</span>
                @Html.HiddenFor(model => model.ViewBusGuideSelectedThirdPaymentMethod)
                <div id="BusGridBusGuideThirdPaymentMethodView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusGuidePayMeth3FormHtmlDiv">
            <div class="OperationHotelPayments">
                <span>Guide Pay 3 Details</span>
            </div>
        </div>
        <div id="BusGuideDateThirdPaymentDiv">
            <div class="OperationHotelPayments">
                <span>Guide Date of 3rd Payment</span>
                @Html.HiddenFor(model => model.ViewBusGuideDateThirdPayment)
                <div id="BusGridBusGuideDateThirdPaymentView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
        <div id="BusNotesDiv">
            <div class="OperationHandsontable">
                <span>Notes</span>
                @Html.HiddenFor(model => model.ViewBusNotes)
                <div id="BusGridBusNotesView" class="BusGridViewBtn" onclick="BusGridColumnHideUnhide(this)"></div>
            </div>
        </div>
    </div>
    <div id="OperBusGrid" class="handsontable" style="width: 1185px; height:420px; overflow:auto;"></div>
    @Html.HiddenFor(model => model.BusPageNumber)
    @Html.HiddenFor(model => model.IsBusFilter)
    @Html.HiddenFor(model => model.IsBusSearch)
    @Html.HiddenFor(model => model.IsBusView)
    @Html.HiddenFor(model => model.IsBusCanPrev)
    @Html.HiddenFor(model => model.IsBusCanNext)
    @Html.HiddenFor(model => model.BusLeftScrollPossition)
    @Html.HiddenFor(model => model.BusTopScrollPossition)
    
     
    @Html.HiddenFor(model => model.IsRemoveBusFilterDivShow)
    @Html.HiddenFor(model => model.IsRemoveBusCustomerCodeFilter)
    @Html.HiddenFor(model => model.IsRemoveBusGroupCodeFilter)
    @Html.HiddenFor(model => model.IsRemoveBusGroupNameFilter)
    @Html.HiddenFor(model => model.IsRemoveBusVendorNameFilter)
    @Html.HiddenFor(model => model.IsRemoveBusStartCityFilter)
    @Html.HiddenFor(model => model.IsRemoveBusEndCityFilter)
    @Html.HiddenFor(model => model.IsRemoveBusStatusFilter)
    
    @Html.HiddenFor(model => model.BusTotCost)
    @Html.HiddenFor(model => model.BusTotCostCad)
    <div style="width:100%;height:25px;text-align:center;margin-top:15px;float:right">
        @if (Model.IsBusCanPrev)
        {
            <input type="button" id="BusPrevBtn" onclick="BusPrevBtnClick()" class="btn14" value="Prev" style="margin-left:10px;">
        }
        else
        {
            <input type="button" id="BusMoreBtn" onclick="BusPrevBtnClick()" class="btn14" value="Prev" disabled="disabled" style="margin-left:10px;">
        }
        <span style="padding-left:15px;padding-right:15px">@Html.LabelForModel(Model.BusCount)</span>
        @if (Model.IsBusCanNext)
        {
            <input type="button" id="BusMoreBtn" onclick="BusNextBtnClick()" class="btn14" value="Next" style="margin-left:10px;">
        }
        else
        {
            <input type="button" id="BusMoreBtn" onclick="BusNextBtnClick()" class="btn14" value="Next" disabled="disabled" style="margin-left:10px;">
        }
    </div>
    if (Model.OperationPLBusView)
    {
        <div class="OperationTabsTitleDiv">
            <span class="OperationTabsTitle">Bus P/L</span>
        </div>
        if (Model.OperationPLBusTotalBusPaidView || Model.OperationPLBusTotalGuidePaidView)
        {
            <div class="row form-row" style="@(@Model.Rows != null && @Model.Rows.Count > 0 ? "" : "display:none");width:840px !important;float:left !important;margin-left:10px !important;">
                @if (Model.OperationPLBusTotalBusPaidView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width:49%;">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.BusTotalPaidSum)</span>
                            @Html.Raw(Model.BusTotalPaidSum)
                        </div>
                    </div>
                }
                @if (Model.OperationPLBusTotalGuidePaidView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width:49%;margin-left:10px">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.GuideTotalPaidSum)</span>
                            @Html.Raw(Model.GuideTotalPaidSum)
                        </div>
                    </div>
                }
            </div>
        }
        if (Model.OperationPLBusTotalBusDiffView || Model.OperationPLBusTotalGuideDiffView || Model.OperationPLBusTotalGuideStepOnView)
        {
            <div class="row form-row" style="@(@Model.Rows != null && @Model.Rows.Count > 0 ? "" : "display:none");width:840px !important;float:left !important;margin-left:10px !important;">
                @if (Model.OperationPLBusTotalBusDiffView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width:33%;">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.BusDifferenceSum)</span>
                            @Html.Raw(Model.BusDifferenceSum)
                        </div>
                    </div>
                }
                @if (Model.OperationPLBusTotalGuideDiffView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width:32%;margin-left:10px">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.GuideDifferenceSum)</span>
                            @Html.Raw(Model.GuideDifferenceSum)
                        </div>
                    </div>
                }
                @if (Model.OperationPLBusTotalGuideStepOnView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width:32%;margin-left:10px">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.GuideTotalStepOnSum)</span>
                            @Html.Raw(Model.GuideTotalStepOnSum)
                        </div>
                    </div>
                }
            </div>
        }
        if (Model.OperationPLBusTotalBusCostView || Model.OperationPLBusTotalGuideCostView || Model.OperationPLBusTotalGuideMiscDiffView)
        {
            <div class="row form-row" style="@(@Model.Rows != null && @Model.Rows.Count > 0 ? "" : "display:none");width:840px !important;float:left !important;margin-left:10px !important;">
                @if (Model.OperationPLBusTotalBusCostView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width:33%;">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.BusTotalCostAmtSum)</span>
                            @Html.Raw(Model.BusTotalCostAmtSum)
                        </div>
                    </div>
                }
                @if (Model.OperationPLBusTotalGuideCostView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width:32%; margin-left:10px">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.GuideTotalCostAmtSum)</span>
                            @Html.Raw(Model.GuideTotalCostAmtSum)
                        </div>
                    </div>
                }
                @if (Model.OperationPLBusTotalGuideMiscDiffView)
                {
                    <div class=" col-lg-6 withoutPadding" style="width: 32%; margin-left: 10px;">
                        <div class="input-group">
                            <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.GuideTotalMiscDiffSum)</span>
                            @Html.Raw(Model.GuideTotalMiscDiffSum)
                        </div>
                    </div>
                }
            </div>
        }
        if (Model.OperationPLHotelGrpProfitView )
        {
            <div class="row form-row" style="@(@Model.Rows != null && @Model.Rows.Count > 0 ? "" : "display:none");width:840px !important;float:left !important;margin-left:10px !important;">
                   <div class=" col-lg-2 withoutPadding" style="width:33% !important;">
                       <div class="input-group">
                           <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.BusGroupProfit)</span>
                           @Html.Raw(Model.BusGroupProfit)
                       </div>
                   </div>

                   <div class=" col-lg-2 withoutPadding" style="width: 32% !important; margin-left: 10px;">
                       <div class="input-group">
                           <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.BusProfitPers)</span>
                           @Html.Raw(Model.BusProfitPers)
                       </div>
                   </div>
                   
                   <div class=" col-lg-2 withoutPadding" style="width: 32% !important; margin-left: 10px;">
                       <div class="input-group">
                           <span class="input-group-addon SumControlsLabelFSize">@Html.LabelFor(model => model.BusTotInvoice)</span>
                           @Html.Raw(Model.BusTotInvoice)
                       </div>
                   </div>
            </div>
        }
    }
    <div style="width:330px;height:25px;text-align:center;margin-top:15px;float:right">
        <div style="margin:0">
            <button class="btn14 pull-right" id="OperBusSaveBtn" onclick="BusGridSave()" style="margin-top:10px; margin-right:7px;" type="button">Save</button>
            <input type="button" id="BusGetSelected" class="btn14 btn120 pull-right" value="Copy For Email" disabled="disabled" style="margin-top:10px;margin-right:10px;">
        </div>
    </div>
    <button style="display:none;" id="BusGridUpdate" type="submit"></button>
}





